package com.cloudkinto.service.order.impl;

import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloudkinto.common.DicBusinessItemConstant;
import com.cloudkinto.common.constant.GlobalConstants;
import com.cloudkinto.common.constant.SysConstant;
import com.cloudkinto.common.exception.BizException;
import com.cloudkinto.common.utils.ExcelUtils;
import com.cloudkinto.common.utils.OkHttpUtils;
import com.cloudkinto.common.utils.StringsUtil;
import com.cloudkinto.common.utils.TimeUtils;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.dao.*;
import com.cloudkinto.entity.*;
import com.cloudkinto.service.email.MailSenderService;
import com.cloudkinto.service.operate.OperateRecordService;
import com.cloudkinto.service.operate.vo.OperateRes;
import com.cloudkinto.service.order.OrderRakutenPackageService;
import com.cloudkinto.service.order.OrderRakutenProductService;
import com.cloudkinto.service.order.OrderRakutenService;
import com.cloudkinto.service.order.vo.ComfirmRakutenResponse;
import com.cloudkinto.service.order.vo.OrderRakutenCouponRequest;
import com.cloudkinto.service.order.vo.OrderSenderUpdateReq;
import com.cloudkinto.service.order.vo.amazon.OrderBaseInfoUpdateReq;
import com.cloudkinto.service.order.vo.rakuten.*;
import com.cloudkinto.service.orderoutput.OrderOutputService;
import com.cloudkinto.service.orderoutput.vo.OrderOutputAddReq;
import com.cloudkinto.service.orderoutput.vo.OrderOutputPackageAddReq;
import com.cloudkinto.service.orderoutput.vo.OrderOutputProductAddReq;
import com.cloudkinto.service.region.JpRegionService;
import com.cloudkinto.service.shipprice.ShipPriceService;
import com.cloudkinto.service.shop.ShopService;
import com.cloudkinto.utils.FreeMarkerUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpMethod;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import javax.mail.Session;
import javax.mail.Transport;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * <p>
 * service实现类
 * </p>
 *
 * @author 张永远
 * @since 2020-06-03
 */
@Service
public class OrderRakutenServiceImpl extends ServiceImpl<OrderRakutenDao, OrderRakutenDo> implements OrderRakutenService {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private OrderRakutenDao dao;
    @Autowired
    private OrderRakutenPackageDao packageDao;
    @Autowired
    private OrderRakutenProductDao productDao;
    @Autowired
    private ShopService mShopService;
    @Autowired
    private OrderRakutenProductService rakutenProductService;
    @Autowired
    private OrderRakutenPackageService rakutenPackageService;

    @Autowired
    private ProductInfoDao productInfoDao;
    @Autowired
    private ProductSkuMapDao productSkuMapDao;

    @Autowired
    private OrderOutputService outputService;
    @Autowired
    private OperateRecordService operateRecordDao;
    String[] strings = new String[]{
            "75a4f41036091786cad09f85d45c844fs1@pc.fw.rakuten.ne.jp", "ce7ce60e1ee54af1f374d9953d83bab9s1@pc.fw.rakuten.ne.jp", "aff7c001b7b3e16cf6dd66d9c3a90d03s1@pc.fw.rakuten.ne.jp", "214af8b01273da40f5edef03654802a5sa@pc.fw.rakuten.ne.jp", "412b510aeeef0ff5b1a281849d72bd16s1@pc.fw.rakuten.ne.jp", "95ac5f7299b2b859d6fc314df3674d46s1@pc.fw.rakuten.ne.jp", "64e1e3da8fc7cc0dc1cc7d8fe213a44ds1@im.fw.rakuten.ne.jp", "0ae85cbb33780f88844a481e5b529a11s1@pc.fw.rakuten.ne.jp", "79a44632d9f6f3f7e18e10e8d4dfe324s1@pc.fw.rakuten.ne.jp", "a01d9a53b537a73c9ac656e0b96b03cds1@pc.fw.rakuten.ne.jp", "b6e507890b25a97ee1fb1b65c6885105s1@pc.fw.rakuten.ne.jp", "c83fd2468604c8b8baf6137ae5d2c6b1s1@pc.fw.rakuten.ne.jp", "b7998b1e268ddb0a81dbe9ed5c22869as1@pc.fw.rakuten.ne.jp", "c0c7e01406eee0baf47b9b3b9a1f470bs1@pc.fw.rakuten.ne.jp", "c0daa5ad43ae267095beceaf0d40d03cs1@pc.fw.rakuten.ne.jp", "c191fbf519650526edb1ddb307bae69cs1@km.fw.rakuten.ne.jp", "c527e3449f0ded5cc77e48b7049e4b82s1@pc.fw.rakuten.ne.jp", "c6291d9192f5ea2b71d200f068d067des1@dm.fw.rakuten.ne.jp", "ca8bf26f5acd16c93a49baaa1b8d0cfcs1@pc.fw.rakuten.ne.jp", "cd9eca334e77c27c4440d0014084bd23s1@pc.fw.rakuten.ne.jp", "d9879124da445a37c852d0d28b33d3bfs1@pc.fw.rakuten.ne.jp", "daeb6878694f916199ade55199f0f481s1@km.fw.rakuten.ne.jp", "e4dbe0307e4048bae524f8fa5a78ef3bs1@pc.fw.rakuten.ne.jp", "e590a67f757955150043108c1ae1f055s1@pc.fw.rakuten.ne.jp", "e8fa5e8adb3569e0912fc1aae0543750s1@pc.fw.rakuten.ne.jp", "eb7e708eff8b29ab618448f97ae7d7c7s1@dm.fw.rakuten.ne.jp", "ec0c4146ca48988bd70c79bb98993adds1@pc.fw.rakuten.ne.jp", "ecb2ce49e4a1c78dd5a4a057101cb7e3s1@pc.fw.rakuten.ne.jp", "ef9f8ed3a1dbc073be5cd87977eefc07s1@pc.fw.rakuten.ne.jp", "f064d266ccbf9fb906b47d3272c4fc1bs1@pc.fw.rakuten.ne.jp", "fa1f7f080f931fa5176906c3a8745399s1@pc.fw.rakuten.ne.jp", "0024a73cb12fc35983c605dd47391cces1@pc.fw.rakuten.ne.jp", "0192481957bf532a37ff9f1a5af2bc6ds1@pc.fw.rakuten.ne.jp", "08d25ddb4fc87c7be59119d305e7a35bs1@pc.fw.rakuten.ne.jp", "0f754d376b5adf331efc7de6a76359a1s1@dm.fw.rakuten.ne.jp", "1254dfbdbf030a3fd109aa66f822be83s1@pc.fw.rakuten.ne.jp", "166a6302447d465aaf935e0a7efdc64as1@pc.fw.rakuten.ne.jp", "1833dcb1e5d0346ab38e843c0effbb05s1@ym.fw.rakuten.ne.jp", "2910c5b596c7db16b65305f32197cba1s1@pc.fw.rakuten.ne.jp", "3f06be22fe35ff609f41875fd42c958as1@pc.fw.rakuten.ne.jp", "3ff373a281518fdb15814775d0f6a4a2s1@dm.fw.rakuten.ne.jp", "4178782921fd3b93456157b1bae202a3s1@pc.fw.rakuten.ne.jp", "42f9c68d5f33d666452193987d5018bcs1@pc.fw.rakuten.ne.jp", "48ae19cc3882dd57fd32c776f459ffe2s1@pc.fw.rakuten.ne.jp", "4c1fc02b95051f7b750e17c4e9adf94cs1@pc.fw.rakuten.ne.jp", "4cf5f4fd5e7c45fba058fbcfe94507f3s1@ym.fw.rakuten.ne.jp", "4f51663916d4204ce99397b16a9e6987s1@pc.fw.rakuten.ne.jp", "509e7f5e9f1be9ac4f7cdf47d2c46007s1@pc.fw.rakuten.ne.jp", "52f22517787cedbf87989a91d25b13b9s1@km.fw.rakuten.ne.jp", "5c5c056b58a3e6d55c865af9ffa571e7s1@pc.fw.rakuten.ne.jp", "6077a89a863e61e68447ccdcb7f3e949s1@pc.fw.rakuten.ne.jp", "6468f9fe1bb32061e3e9f404008a4b94s1@pc.fw.rakuten.ne.jp", "64af92adbd4bc521a9aab368c0bbc74bs1@km.fw.rakuten.ne.jp", "64df0a94447c22c7f3f1c14fdd16cba0s1@pc.fw.rakuten.ne.jp", "6beb6aad0745479bb63fd432cecab914s1@km.fw.rakuten.ne.jp", "6ef185803f753455e21fadefb6d3c8fcs1@pc.fw.rakuten.ne.jp", "7020a734bdcf86167790eac1cfc9bf7es1@pc.fw.rakuten.ne.jp", "7182542c2deab1d46fbe7fd482bcceecs1@pc.fw.rakuten.ne.jp", "7b8242e33b902034dd97c183cd826491s1@pc.fw.rakuten.ne.jp", "7e3b082d2a802626115372b8594386b7s1@pc.fw.rakuten.ne.jp", "7e4d7851d09bf76af340f499abde1b17s1@im.fw.rakuten.ne.jp", "7f5d551ab6233b26a77998dac10e700ds1@pc.fw.rakuten.ne.jp", "81d1950563cd74b94c8772a67824203fs1@pc.fw.rakuten.ne.jp", "891efcf22f4155fef5f3155a19197320s1@pc.fw.rakuten.ne.jp", "92706aafa630787cef3fc2249c8f791fs1@dm.fw.rakuten.ne.jp", "96a5eb76c0e4232e571ed25ce2393aa6s1@pc.fw.rakuten.ne.jp", "9ad0aa47a632651134f3392acef57a53sa@pc.fw.rakuten.ne.jp", "9e730bb294c5560692ea059b26f03f6ds1@pc.fw.rakuten.ne.jp", "a219b3d4caa853a8dd641f4f8f309445s1@km.fw.rakuten.ne.jp", "a22e06e42b4373d3045a39778d529d7ds1@km.fw.rakuten.ne.jp", "b38db779fc351514169c149abfd6742bs1@pc.fw.rakuten.ne.jp", "00474b5eecbd6e0b8706e8007212dc0bs1@pc.fw.rakuten.ne.jp", "0172c509858ae71320916f6992748ba7s1@pc.fw.rakuten.ne.jp", "017396df2fa59a4c2e260bc71a631952s1@km.fw.rakuten.ne.jp", "01f2f1bce04cab10ae67489126f71a12s1@km.fw.rakuten.ne.jp", "02c0af5025586cd1d8e7a8d5aefaac5es1@pc.fw.rakuten.ne.jp", "02e2312422a38a12f808e024f0990410sa@pc.fw.rakuten.ne.jp", "02ff728868ef684a0f125db9e2bdbd9csa@pc.fw.rakuten.ne.jp", "035f65a76974dfca653f4c286d0fe488s1@pc.fw.rakuten.ne.jp", "03958467743d2234f52947c1fc756bces1@dm.fw.rakuten.ne.jp", "03dbbee1afff5ce8d2a8f796b1c425bcs1@pc.fw.rakuten.ne.jp", "0467040c31fe0a251ccadda2bf9d63b3s1@im.fw.rakuten.ne.jp", "04a7a81150f7a30dd8260f931ed491e5s1@pc.fw.rakuten.ne.jp", "04da68e6502fe3679aeab07603b5ac98s1@im.fw.rakuten.ne.jp", "04e4c9ba63ef30f654b0e6bb7be213a1s1@pc.fw.rakuten.ne.jp", "053d146a7ea6d3aabf56b406ec54776cs1@pc.fw.rakuten.ne.jp", "055fc095f3e4ee28106945ed97dfd42as1@pc.fw.rakuten.ne.jp", "059ae4f761ed8f35f43c9a7a68c7809es1@dm.fw.rakuten.ne.jp", "061438e414d8083a5615b120be4b8533s1@pc.fw.rakuten.ne.jp", "062b22392287316f88765b7f148aa776s1@pc.fw.rakuten.ne.jp", "067f9f5b79258f57bbeaab4c0cc54935s1@pc.fw.rakuten.ne.jp", "06a6abd3d0eb0a53b621c862e0fc5697s1@dm.fw.rakuten.ne.jp", "0754474d50577a48650df62cd56c56f7s1@pc.fw.rakuten.ne.jp", "0759e5e0cb49337e7a96372d3cfb569cs1@pc.fw.rakuten.ne.jp", "077d4c8a2e3fccd2d7e8b27355754e77s1@pc.fw.rakuten.ne.jp", "0793131e781d59e5d8f7b2712f1bd78as1@pc.fw.rakuten.ne.jp", "08d0cc509ba17f217ad672c9baa4c547s1@pc.fw.rakuten.ne.jp", "08fb348655e59887199bfa6d896b8416s1@pc.fw.rakuten.ne.jp", "0926b30fbc086ab023fafbb1ad401bf6s1@pc.fw.rakuten.ne.jp", "09588b64073df48661634b68435c6f04s1@pc.fw.rakuten.ne.jp", "0a0cad21d7a7308596eebfe9c33388e4s1@pc.fw.rakuten.ne.jp", "0abe6eac682864215cf4c49c376801a3s1@pc.fw.rakuten.ne.jp", "0acf2ffee0bd5959065768c7de24156ds1@pc.fw.rakuten.ne.jp", "0aef6d8f80033351583b79f0659ff6acs1@pc.fw.rakuten.ne.jp", "0b668edbe6a1fa560135db019aeda77ds1@dm.fw.rakuten.ne.jp", "0bb6806ee12fa7738062f3ef3607ebb0s1@pc.fw.rakuten.ne.jp", "0bf57a33d6bdc376a2e036af5ae9f4f0sa@pc.fw.rakuten.ne.jp", "0c33f58c5d6d6630c10aa2f5a49a68a5s1@pc.fw.rakuten.ne.jp", "0cc6b210d8031b7cbb85fb988baabb13s1@dm.fw.rakuten.ne.jp", "0cfa87ec330ce4ae2724067ff0043086s1@pc.fw.rakuten.ne.jp", "0d21d8a3b3194f793347b4513d1eaaf3s1@im.fw.rakuten.ne.jp", "0d675475894c337b75dd3e68827aee7esa@pc.fw.rakuten.ne.jp", "0d8489798daaf3b742dfa4715b4b8111s1@dm.fw.rakuten.ne.jp", "0d993659bbdaa8aa30d34022a6285a7esa@im.fw.rakuten.ne.jp", "0e1585fa5fde44d73faae1e02d2baa9fs1@pc.fw.rakuten.ne.jp", "0e22524ac4ef5886a7ddc654c7357975s1@pc.fw.rakuten.ne.jp", "0f279bc2825631850b68e2ff7f3cc72fs1@dm.fw.rakuten.ne.jp", "0f7616bf075b9f72e4e9de15823cd5ccs1@dm.fw.rakuten.ne.jp", "0fea48e03bdc83840fd77742e9bfb7d3sa@pc.fw.rakuten.ne.jp", "0fed7fd755c04769738d533577583879sa@im.fw.rakuten.ne.jp", "107b1563f652f480de3d2f4c3e1963ads1@pc.fw.rakuten.ne.jp", "10fb5a9f569e2c25fa905174f66e8cbes1@pc.fw.rakuten.ne.jp", "1169765df86b39a62531508caab2e383s1@pc.fw.rakuten.ne.jp", "12d7c3aef6f70dd3ae1324608e1ad5aes1@pc.fw.rakuten.ne.jp", "12e78d14d4805df49e259c2dcc749b89s1@ym.fw.rakuten.ne.jp", "13a076b5f1dd4e9da853729bb76a162es1@pc.fw.rakuten.ne.jp", "1401183d6e72c005f28ea23d5885e453s1@pc.fw.rakuten.ne.jp", "1528d982f42ef568f8c7d8d57e3e5917s1@km.fw.rakuten.ne.jp", "1533eff51b5bcc90e6c3418286762a9es1@pc.fw.rakuten.ne.jp", "156cf3601febb57ef0664c239759409es1@pc.fw.rakuten.ne.jp", "1588426fbc6b25bf563f94992adea61fs1@dm.fw.rakuten.ne.jp", "16106ca0573a20e5df2b5059ee288716s1@pc.fw.rakuten.ne.jp", "1692ab4b889eb8ef7314de1a3a6231c0s1@pc.fw.rakuten.ne.jp", "1693f23072a36d3cd5f8acf43e313bf8s1@pc.fw.rakuten.ne.jp", "16d489bef1b3cbf98617da4e14d05edas1@km.fw.rakuten.ne.jp", "174bd884dbd508ba0614b4a6063bba6cs1@dm.fw.rakuten.ne.jp", "17545c84920100803bab872ab4cf07efs1@pc.fw.rakuten.ne.jp", "17e8757ba809c1843cd31a0d7fa9082as1@pc.fw.rakuten.ne.jp", "182057366f2869c20d630cbad5fc620cs1@pc.fw.rakuten.ne.jp", "182e04d69c2c19f09e702f79298f29e1s1@pc.fw.rakuten.ne.jp", "1885e797b3fc3d46fb7a0c2bd0dc4c12s1@pc.fw.rakuten.ne.jp", "1897be2d7a890225e20d9bdca7e5e6fbs1@pc.fw.rakuten.ne.jp", "18c055e0e0619192169a217dbf5466b5s1@pc.fw.rakuten.ne.jp", "193201020bfbf96f8a92893610b78029s1@pc.fw.rakuten.ne.jp", "19bf51ec52ade652579d9643a18588d0s1@pc.fw.rakuten.ne.jp", "19e2534ac2f285fb600f8b368ce5c995s1@pc.fw.rakuten.ne.jp", "1a0840633ce5c6059f25e42ccace041ds1@dm.fw.rakuten.ne.jp", "1b026c8e07750054799d28bdf07e318fs1@pc.fw.rakuten.ne.jp", "1b6cbb6dd1e311512744f68e071dc77es1@pc.fw.rakuten.ne.jp", "1b76f0b297237ce6737925f6bf8ee629s1@pc.fw.rakuten.ne.jp", "1c11c54ac4a1f18a7ae0b0721e32c404s1@pc.fw.rakuten.ne.jp", "1c699ee726992b31006dbdc6a39957fds1@km.fw.rakuten.ne.jp", "1ff6529653f4346d12c67a8cc4c4ab7ds1@pc.fw.rakuten.ne.jp", "224d80f1a09c30c5b65b09415ec8cc3es1@km.fw.rakuten.ne.jp", "232dce06a67e80bdfa842b3922c9e0d0s1@pc.fw.rakuten.ne.jp", "233a9ecef0ddda8d87e1f15cab0eef9bs1@pc.fw.rakuten.ne.jp", "24327939dbd0e19c11508bbd332f189es1@pc.fw.rakuten.ne.jp", "2506348b46eff27a8cf506c9a34df963s1@pc.fw.rakuten.ne.jp", "250da454ca5152373a2c796fe859f799s1@pc.fw.rakuten.ne.jp", "259e6fef9999ab8951d1f9fef7a2521bs1@pc.fw.rakuten.ne.jp", "25a90b4f1a59dad2fa091214397d1f91s1@pc.fw.rakuten.ne.jp", "25f3c1fe33297b9d5c9e5a0060e2daffs1@dm.fw.rakuten.ne.jp", "2627a26eb847d4db98376bad046ad43cs1@pc.fw.rakuten.ne.jp", "26571aa8093925b6966acefadbbe75cds1@im.fw.rakuten.ne.jp", "26a20810a9bdfb6e7531d88516081675s1@pc.fw.rakuten.ne.jp", "2789da5de538eea54b0e958e3ea1c644s1@dm.fw.rakuten.ne.jp", "290fd4bc86195d865f769794d00d1ecfs1@pc.fw.rakuten.ne.jp", "2938f72c162c313627ab8bde1103b07cs1@pc.fw.rakuten.ne.jp", "293c946026e3e7894dc0636e684e4caes1@km.fw.rakuten.ne.jp", "297134f0344829cfb8f613d365f4ebd4s1@pc.fw.rakuten.ne.jp", "2aa237bdb2d79664b0c4decddae4b7d1s1@km.fw.rakuten.ne.jp", "2b4bcee57d33c59e97c8670fc8aed832s1@pc.fw.rakuten.ne.jp", "2bdfad06f4c06f5c513d3ff20715bd82s1@km.fw.rakuten.ne.jp", "2c3bac91ac68c3ae2ab8d731595761d8s1@pc.fw.rakuten.ne.jp", "2c494bc460f8b40cbd22bc88b4e2d4b8s1@pc.fw.rakuten.ne.jp", "2c998c6d4a440c8a1b79a0348cc2a2a0sa@pc.fw.rakuten.ne.jp", "2cb049504d3513ccac3df3695d140c76s1@pc.fw.rakuten.ne.jp", "2d1ed81f23535ff90f3ce9b8b4174499s1@pc.fw.rakuten.ne.jp", "2d33d3431ac30119387dfc2b08a89edbs1@ym.fw.rakuten.ne.jp", "2d3771525b1283faf3da42f2a45c0f9bs1@pc.fw.rakuten.ne.jp", "2d8129df534ae28a94eb0ba22b479b90s1@pc.fw.rakuten.ne.jp", "2d93dc26912a2a631efdfd9907cac3ces1@km.fw.rakuten.ne.jp", "2ec964f81931cfc04326fcf42672a712s1@pc.fw.rakuten.ne.jp", "2ecd8c8f36922f075c55eafe27b1d6a6s1@pc.fw.rakuten.ne.jp", "2ecfe16b7276b48286fc3040bbd83a02s1@km.fw.rakuten.ne.jp", "2f35348df2bba048a8e8f3532487fb4es1@pc.fw.rakuten.ne.jp", "2f3798c56c94ed6a058c6064d9c8d466s1@pc.fw.rakuten.ne.jp", "2f6f0011517db2694a9ba36d102d50bas1@pc.fw.rakuten.ne.jp", "2fd03c6205f7d3c21b46edcbb14b6156s1@pc.fw.rakuten.ne.jp", "301ce05705276a9251c49015777f9ec8s1@km.fw.rakuten.ne.jp", "304b4680a7243fa34804340d7579427cs1@pc.fw.rakuten.ne.jp", "30568953726ff0095263f3ed3fc09430s1@ym.fw.rakuten.ne.jp", "305ef76f08daa9568e3c529de25ae215s1@pc.fw.rakuten.ne.jp", "3114d93c2630dbda6a7dff3d4584740as1@pc.fw.rakuten.ne.jp", "3125434ccc170c13b81e98757dfeafb6s1@pc.fw.rakuten.ne.jp", "316182734b2984a47a441eda57e0fd3cs1@pc.fw.rakuten.ne.jp", "31e6878148e3f2edd82a6ab236341f63sa@pc.fw.rakuten.ne.jp", "31ebdb0c78cebc75e9a6709d731081ccs1@pc.fw.rakuten.ne.jp", "31ed23c11200e375759d7d96aba3a05ds1@pc.fw.rakuten.ne.jp", "3245ed87bae67445bde37bc5c681dd28s1@pc.fw.rakuten.ne.jp", "3246cdee29353549e473bace5c477379s1@pc.fw.rakuten.ne.jp", "3287997354d4f1047eba95d38c72a093s1@im.fw.rakuten.ne.jp", "328ea82886209e9340193f6fedecccees1@km.fw.rakuten.ne.jp", "334ca0892ecaf264ead9298e06ec7309sa@pc.fw.rakuten.ne.jp", "33fe7e37c3ab9cc608d9f49d5664d9ecs1@pc.fw.rakuten.ne.jp", "34279f148dfcde7490fabe2149826f6es1@dm.fw.rakuten.ne.jp", "34c60c361c027f3836abcf91eca9a4d5s1@km.fw.rakuten.ne.jp", "355a9f08c221799174595525a405c61cs1@pc.fw.rakuten.ne.jp", "35bf1a499e0def03ae065096a82a0cc6s1@pc.fw.rakuten.ne.jp", "3673d64e81ae1650963752be038756ccs1@pc.fw.rakuten.ne.jp", "367eb10662682382ab045c455242e44es1@km.fw.rakuten.ne.jp", "369769f38959f97c671404bc159e01a7s1@pc.fw.rakuten.ne.jp", "374480a30370c4ee75124fd544602924sa@pc.fw.rakuten.ne.jp", "3780f7b0447b730293f3feb8805333b0s1@pc.fw.rakuten.ne.jp", "37917b098fa2055012fce0363e4f021cs1@pc.fw.rakuten.ne.jp", "37964fe5d0882e97fbb6b2dec18d2815s1@im.fw.rakuten.ne.jp", "387e1f05b3c75a78f289719c2d7213d6s1@pc.fw.rakuten.ne.jp", "38a287d3d687af10b4adaf99cc0cbbb6s1@pc.fw.rakuten.ne.jp", "390b6a354c96be050c3aad2bc38ad2eas1@pc.fw.rakuten.ne.jp", "391954a7544d4bf26e75eee630ef7e03s1@pc.fw.rakuten.ne.jp", "394d609ba19648c6f7d9862b0803f3a6s1@pc.fw.rakuten.ne.jp", "3983e111a0b935bcd3bd90f55a4743ecs1@pc.fw.rakuten.ne.jp", "3aa69e673fc0b86804276693d538ea1cs1@pc.fw.rakuten.ne.jp", "3aadda3a237b89d0a619ca06a8c2cd8cs1@pc.fw.rakuten.ne.jp", "3ac069f5a3b7a196976f567eb21b4c68s1@pc.fw.rakuten.ne.jp", "3aede7212c734abb400644f240cb94cas1@pc.fw.rakuten.ne.jp", "3bdb6e18689fd6b01c799e2e0e7b404as1@pc.fw.rakuten.ne.jp", "3d4bba6357f06cfd4f4f89cd2a35c8c6s1@pc.fw.rakuten.ne.jp", "3d539fd3e68b445d85c53263ec1ca457s1@pc.fw.rakuten.ne.jp", "3d5c2a581035bb5915e7f8a0ff81b244s1@im.fw.rakuten.ne.jp", "3dc130ab7088697514333a623d96eb42s1@pc.fw.rakuten.ne.jp", "3deacc59b4a7a62431fc1c9dcfc1fbdbs1@dm.fw.rakuten.ne.jp", "3df0981d8a772c215bace89f9c3c8b21s1@pc.fw.rakuten.ne.jp", "3e18922c3a426cd4b792473e1e9fda35s1@pc.fw.rakuten.ne.jp", "3ec4714976bf9314b3ae87b20e41611bs1@pc.fw.rakuten.ne.jp", "3f5aa26ab8974b2c0265cdaeffc95821s1@pc.fw.rakuten.ne.jp", "3f64348230042b2579b749660970bfc3s1@pc.fw.rakuten.ne.jp", "3f7927809b43d6b7f9ff02e3cbc56d1as1@dm.fw.rakuten.ne.jp", "3f975189442ef2facbccada673b018acs1@ym.fw.rakuten.ne.jp", "3fa71719d53441d8a4a5fa52de6244acs1@km.fw.rakuten.ne.jp", "409419a1c2e20c2816ce22313d561ae9s1@dm.fw.rakuten.ne.jp", "4110488c92f01068eb189b24bc1c956as1@pc.fw.rakuten.ne.jp", "4161f74a2757f7c495c447e2c04fbd2cs1@pc.fw.rakuten.ne.jp", "41727581d280e3ef2f77fd60fe628f43s1@pc.fw.rakuten.ne.jp", "4182c605f05cbbfc7cd6fa5d65b489b2s1@pc.fw.rakuten.ne.jp", "418e73813a6f54b5b547a76a4d6035fcs1@pc.fw.rakuten.ne.jp", "418fc9cfa4058e012d1f8dc4ff399140s1@pc.fw.rakuten.ne.jp", "419bb1cfac233dc48878bb7d8e17e308s1@km.fw.rakuten.ne.jp", "42041fd313f1c82765e3534880bf52f3s1@km.fw.rakuten.ne.jp", "426f551ff95b542a31e3352722b8ac98s1@pc.fw.rakuten.ne.jp", "42e9035e70d20c4853680ca1249c51bas1@dm.fw.rakuten.ne.jp", "42ecdea6267b941a1071ed0347a59ee9s1@pc.fw.rakuten.ne.jp", "433909ec818da3ce24231963b5c0e2b9s1@pc.fw.rakuten.ne.jp", "435d629255aa0ef3cdfec16dd2e1bc91s1@pc.fw.rakuten.ne.jp", "438e24ff545f523f041c6ce49292a6c7s1@pc.fw.rakuten.ne.jp", "43b4d3786b5d375c496be0eb1db4b52as1@dm.fw.rakuten.ne.jp", "441e75a2f8e52f2eef055eaf9ccbb0d4s1@km.fw.rakuten.ne.jp", "44702bcb343bdb52a07216a882cd98d4s1@km.fw.rakuten.ne.jp", "44d542a2448640c7e2eca343b0c04158s1@pc.fw.rakuten.ne.jp", "457daaa7f4b7165933bc652bc9a5cb8cs1@pc.fw.rakuten.ne.jp", "45e5d8eb9799e5526686a2b18a07d340s1@pc.fw.rakuten.ne.jp", "45f4bfc2b9b086517a0696391ded3f15s1@km.fw.rakuten.ne.jp", "4643836129ccf502b620bc7988aba7d2s1@dm.fw.rakuten.ne.jp", "46592b00d3315e6d8ee338c0a4ae5085s1@pc.fw.rakuten.ne.jp", "46608a1f2afab74b697e27db30fe68efs1@pc.fw.rakuten.ne.jp", "467268fd10b2caa02e2fdc9936c42fc3s1@pc.fw.rakuten.ne.jp", "46c3010126f58b2a344332a1a5c8f872s1@pc.fw.rakuten.ne.jp", "478154c10bb893abeaf84fdcb4682b12s1@pc.fw.rakuten.ne.jp", "481693d085ebb65a8052423932bca093s1@pc.fw.rakuten.ne.jp", "487846b0f24675950b499799a08e91dfs1@pc.fw.rakuten.ne.jp", "48f5d4c59b0823f07697df3e5f004d87s1@km.fw.rakuten.ne.jp", "49347d67239152188b563921378457ads1@pc.fw.rakuten.ne.jp", "494ec6a8e23bd9483ce2b3fddab047dbs1@pc.fw.rakuten.ne.jp", "49aa2b95cfe126ab0749455bd670242as1@km.fw.rakuten.ne.jp", "49c61008e9545df84fc55ff919fe7363s1@pc.fw.rakuten.ne.jp", "4a8db7ddcb6fd8ab313d9fac65d0c8c3s1@pc.fw.rakuten.ne.jp", "4ae93226491b9bed2d3523a6a0da8541s1@dm.fw.rakuten.ne.jp", "4bcff973dd753697a179a1494f7a5a66s1@pc.fw.rakuten.ne.jp", "4bff59ea8e8a71d7786461edb71fefdfs1@pc.fw.rakuten.ne.jp", "4c7385f2456b8ef4805f80398c8251f6s1@pc.fw.rakuten.ne.jp", "4d258967ca81dd689b5a503deceae5e6s1@pc.fw.rakuten.ne.jp", "4d964cf4ad6139bcdfff3298796a49f5s1@dm.fw.rakuten.ne.jp", "4dd5b5ad3a83d37af8df0d7b42aed384s1@pc.fw.rakuten.ne.jp", "4ddfd489b1616662e35c198a688b134es1@pc.fw.rakuten.ne.jp", "4e82fe39841436aa68d138f2cdb6d46cs1@km.fw.rakuten.ne.jp", "4ec24d02024ed00e91f21275f3cca1a5s1@dm.fw.rakuten.ne.jp", "4ed978d6b89ccbfaf95b07bec0d3a78fs1@dm.fw.rakuten.ne.jp", "4edce9321b15c788b1c9c64ea3e31c2es1@km.fw.rakuten.ne.jp", "4f1d3d89d575c7fec1c37e5f4db0fc3es1@pc.fw.rakuten.ne.jp", "4fb64c6a09a3771d048004aa9ab4a12ds1@pc.fw.rakuten.ne.jp", "4fd4f3d2eef954503ea4eac9ab43581ds1@dm.fw.rakuten.ne.jp", "4ff9fb6ed5864ed9f614b75bca77aa80s1@pc.fw.rakuten.ne.jp", "5034844306a45ae9080c0560fe5e3c9ds1@pc.fw.rakuten.ne.jp", "504a4d2d3b56404c83591248da4aae24s1@pc.fw.rakuten.ne.jp", "5053b326743a15a88d56409b1211624es1@dm.fw.rakuten.ne.jp", "508a7b1fc5761fedccecd8ec81a3ad1as1@pc.fw.rakuten.ne.jp", "50979536545324e6d69da2484450b6c5s1@dm.fw.rakuten.ne.jp", "50a6ad77adcf61d51a39e04a210d2012s1@pc.fw.rakuten.ne.jp", "513ec1d7f0543673278024cc81379508s1@pc.fw.rakuten.ne.jp", "514f0536a40573d9869344d41dbf5ebbs1@pc.fw.rakuten.ne.jp", "51add664881a76d968601c6ff9fca2e2s1@km.fw.rakuten.ne.jp", "525b9d12aec68904dbe3d3f8bb07298fs1@pc.fw.rakuten.ne.jp", "52e57a999b1b467acdcea04bafb54481s1@pc.fw.rakuten.ne.jp", "52eb06c5b9681aa9b05c3383681fdc54s1@pc.fw.rakuten.ne.jp", "5351b44a5b9575929d54ecba5f9f6911s1@dm.fw.rakuten.ne.jp", "537f197b8f6dea00e674bf987c0c44fcs1@pc.fw.rakuten.ne.jp", "542a77a59ff95bb4f0ebba062ae5f576s1@pc.fw.rakuten.ne.jp", "5480d8a93d4ac885c6e207b4efdbde6es1@pc.fw.rakuten.ne.jp", "54b361e89701c32e27d068d111795ac9s1@pc.fw.rakuten.ne.jp", "5504143ac34860d111d095452bb97b03s1@pc.fw.rakuten.ne.jp", "55842da25b984f180827fd773d721187s1@pc.fw.rakuten.ne.jp", "55d97c7598dacd1a94f7623aa32c1c51s1@pc.fw.rakuten.ne.jp", "55dee001ceb1b70a58e0bc7d07ac9f70s1@pc.fw.rakuten.ne.jp", "562aac2bd0fdfb2c2d48b7da0603acd3s1@pc.fw.rakuten.ne.jp", "563092dec143af82ed2207cb3de0439es1@pc.fw.rakuten.ne.jp", "569d6afa3cd629214539d2afdeb315a9s1@pc.fw.rakuten.ne.jp", "56d10a505fe074fd989cbface133824ds1@pc.fw.rakuten.ne.jp", "56f48fee1c01c5342838a1dddefb5ac4s1@pc.fw.rakuten.ne.jp", "5747f85aa0197665a8e45c0427442dfas1@pc.fw.rakuten.ne.jp", "58733e16fed583dd9db2ba16109dd1dds1@pc.fw.rakuten.ne.jp", "5878ae2051a042f4bd172c9fbc22873as1@pc.fw.rakuten.ne.jp", "589a015aeca2789da7ba97b930f18eaas1@km.fw.rakuten.ne.jp", "58a07e3d38196522e9067f477b11d916s1@km.fw.rakuten.ne.jp", "595b1bf1f1dd339bbaa99b1aaf21fcafs1@pc.fw.rakuten.ne.jp", "59cb7cab3519a903cc9f34791f2fa944s1@pc.fw.rakuten.ne.jp", "59dc4ff57d61d9e7c628f2b19e4c244ds1@pc.fw.rakuten.ne.jp", "59f1cbe179c472f2f5d21550f6af86f8s1@pc.fw.rakuten.ne.jp", "5a38701629c194864aa695766e608eccs1@pc.fw.rakuten.ne.jp", "5a7895795e7cd4c45307270f29a56d03s1@ym.fw.rakuten.ne.jp", "5abcb65d8866ea8c4c592a06da61a191s1@pc.fw.rakuten.ne.jp", "5b1b27f1601dbb907bac6800d6497fdcs1@km.fw.rakuten.ne.jp", "5c1d2a1de22eee2c1f2e949b4962e535s1@km.fw.rakuten.ne.jp", "5c260b7ed25cb1e2c89a904212f54c77s1@pc.fw.rakuten.ne.jp", "5d1b2b645672e313a90b7ab2f63d51bes1@ym.fw.rakuten.ne.jp", "5d73858e34906d2ff8e45072e7cedf60s1@pc.fw.rakuten.ne.jp", "5dd4e4272b1c63d742a61f6eaccbc9c2s1@pc.fw.rakuten.ne.jp", "5dffa10cbd1b6cf7d3194c420a5f18d2s1@km.fw.rakuten.ne.jp", "5e4c9befcc085fe83884ed35beee27c7s1@pc.fw.rakuten.ne.jp", "5e9704282cf9109f4cf760328b247487s1@pc.fw.rakuten.ne.jp", "5f21dfd4e3fd18c3d4d357b763de382fs1@pc.fw.rakuten.ne.jp", "5f3f5e55a19c80b4bf65f6e1668965ces1@pc.fw.rakuten.ne.jp", "5f6e0896b576ca339159cf01631235e4s1@pc.fw.rakuten.ne.jp", "5fe66aec03abec3e801855374a4505bcs1@km.fw.rakuten.ne.jp", "6018edd98adc98ceaf18797f58f5bfdcs1@pc.fw.rakuten.ne.jp", "604874c13c69a6b7927936e6fbe5615ds1@pc.fw.rakuten.ne.jp", "60b02c74038693acadf68d9ce26b5faas1@pc.fw.rakuten.ne.jp", "60b208abe557f96584a7b076cd3d7837s1@km.fw.rakuten.ne.jp", "6126141777e3efa9694e2bb4ad71ecf6s1@pc.fw.rakuten.ne.jp", "61480756e6d6c647d296b0486eacf9a6s1@pc.fw.rakuten.ne.jp", "6151115e2f5c642fd0647ba215ffe254s1@pc.fw.rakuten.ne.jp", "62141af6dcd82f3b1152566730f58164s1@pc.fw.rakuten.ne.jp", "624b705320d3badee1e28c64a0d6295bs1@pc.fw.rakuten.ne.jp", "6295c667a4bdf982d00350b4c860f653s1@dm.fw.rakuten.ne.jp", "62e91ad8e37fc2ff96582bcaed985330sa@pc.fw.rakuten.ne.jp", "6306b86821b882c89a0bda5b99db3c85s1@pc.fw.rakuten.ne.jp", "635accce6e8658daebe122fd357a7aafs1@pc.fw.rakuten.ne.jp", "6381da959d080d1ab18aced0cd1ff46es1@km.fw.rakuten.ne.jp", "63850700b2379c317a64a63ead1ffe3esa@pc.fw.rakuten.ne.jp", "63bac1336339d77cb81a3cc0990a8cdbs1@km.fw.rakuten.ne.jp", "63be9aa805375c398c4c6bdcc7e9344es1@pc.fw.rakuten.ne.jp", "63c7f816850bd153c39098e111e19bc6s1@pc.fw.rakuten.ne.jp", "6407fcc7fb2c5b8868e3b7f2ea2afdd3s1@pc.fw.rakuten.ne.jp", "642fd1976e5bdc0fba309bb93d919d23s1@pc.fw.rakuten.ne.jp", "6496a061daffe3ffbf58e21d36ba1d8bs1@pc.fw.rakuten.ne.jp", "64980c3cb442d9c260de484a2bf84892s1@pc.fw.rakuten.ne.jp", "64e815c3623c9ba1f1342b579f001b51s1@pc.fw.rakuten.ne.jp", "6525de9309950add3b370ce4f1be4a03s1@pc.fw.rakuten.ne.jp", "65e2aee11945b2183cc794a5cb85e89es1@pc.fw.rakuten.ne.jp", "66604e9583ff2909d26f86dea60dc3eas1@pc.fw.rakuten.ne.jp", "688338e0f47478e8812c268b09ff38b4s1@pc.fw.rakuten.ne.jp", "68fdbdeccb486f55f4d4f51b47ff45f2s1@pc.fw.rakuten.ne.jp", "68fdbfa747e24c526c78963513d51981s1@pc.fw.rakuten.ne.jp", "691b7f34ff124680991dfcc79a5d9995s1@pc.fw.rakuten.ne.jp", "693ec69cc9b73b67e2fa6b77f113e8bes1@pc.fw.rakuten.ne.jp", "694ae1f0410ded30d26d48e56f68eed7s1@pc.fw.rakuten.ne.jp", "6969325eee1d983448a39c81b9c5ba88s1@pc.fw.rakuten.ne.jp", "699584f5804ba33d4d04f3d086530569s1@km.fw.rakuten.ne.jp", "69bf0220e05f9ffff3e76500edf0ca91s1@pc.fw.rakuten.ne.jp", "69c5cd604892465ceb739ab69f7759d5s1@pc.fw.rakuten.ne.jp", "6ad3541ce5716d5eae87b31cefacfb0es1@pc.fw.rakuten.ne.jp", "6b229bbee4751e4c71e2a4ed9ef04471s1@pc.fw.rakuten.ne.jp", "6b998df990ba782655900ce99693446ds1@dm.fw.rakuten.ne.jp", "6bc850666b9c758145e420f83fa4739cs1@pc.fw.rakuten.ne.jp", "6bdad10974da143d78e482d0ef28a6a3sa@km.fw.rakuten.ne.jp", "6be2d78bf577e39dbf274578e4961c5es1@dm.fw.rakuten.ne.jp", "6c0683ecdc68cc0773a94ce60df19cbds1@pc.fw.rakuten.ne.jp", "6ca4852158c9d9785f36e55f458b7aa7s1@pc.fw.rakuten.ne.jp", "6cd53eb367e29d89ce75a978fdc47da9s1@km.fw.rakuten.ne.jp", "6cec2420d0a9ca2a07f20a642cfdbd23s1@pc.fw.rakuten.ne.jp", "6cf5ea9f13b5cb11ddfc4f8c57e5a49as1@km.fw.rakuten.ne.jp", "6d67383fcecf1d11590298cb59b878e1s1@pc.fw.rakuten.ne.jp", "6d9dfcfd35161712b115f0f62c1b1919s1@ym.fw.rakuten.ne.jp", "6e3dd1c336b8b49db428564948afcc1as1@dm.fw.rakuten.ne.jp", "6e767a7536bcfb2f105be1ce8f9f0e83s1@pc.fw.rakuten.ne.jp", "6e9e9363a91575b6c500e7b2c3660728s1@pc.fw.rakuten.ne.jp", "6f034229294dce47eb24b831bd88218bs1@pc.fw.rakuten.ne.jp", "6f1c17f12dc32d10b13c63fcfb5f8ffcs1@pc.fw.rakuten.ne.jp", "6f4e52965c6af4632424950321202ab5s1@pc.fw.rakuten.ne.jp", "6f9b4b50f6678c88e408e9c0facacd94s1@dm.fw.rakuten.ne.jp", "6fcdd5228047926c6d0c23e01677b87ds1@pc.fw.rakuten.ne.jp", "6fd80012274369cf7b8ac3fbc416949ds1@pc.fw.rakuten.ne.jp", "7007c2d07007cd9399eb3f74d99f4712s1@pc.fw.rakuten.ne.jp", "7031762befde19ba75c5d7a3e2c782aes1@pc.fw.rakuten.ne.jp", "7093897e9774f7cea9262c1dd9e69bd9s1@km.fw.rakuten.ne.jp", "70989524e24973baf97c5e754b4bfaa2s1@pc.fw.rakuten.ne.jp", "70afbfe5b0fd70d947fe5ca11414de21s1@pc.fw.rakuten.ne.jp", "70b432a8cf541ff262e3380108f51030sa@pc.fw.rakuten.ne.jp", "7128e3ce28ac95a45fe9df67ffdfd26fs1@pc.fw.rakuten.ne.jp", "717d3517e04d0bd394d85f13a9d1ca97s1@pc.fw.rakuten.ne.jp", "71ebbf0128e783a9b2b045bcb2112d37s1@pc.fw.rakuten.ne.jp", "71fe1ba8da1c1437780b7435ea1a72c4s1@dm.fw.rakuten.ne.jp", "724374efaa05121df752f54ac3f3511cs1@pc.fw.rakuten.ne.jp", "72f8d4acaac91e88aae0c422ab83a905s1@pc.fw.rakuten.ne.jp", "73102256973b869f563d8f79a617ce6bs1@pc.fw.rakuten.ne.jp", "7330020a8b746dd61ba9a4ae73622367s1@pc.fw.rakuten.ne.jp", "7373bf7d1db20c9a6e30088a7e14c16cs1@pc.fw.rakuten.ne.jp", "737d14119d5430a941ea62e33b4ce6b9s1@pc.fw.rakuten.ne.jp", "740f5ed1aeb4e86f33a41ca3e137c8bas1@pc.fw.rakuten.ne.jp", "7414a50768eb3833c1f449d0b85dd01ds1@dm.fw.rakuten.ne.jp", "7650b349e4717337061f9d9c9c4f868es1@pc.fw.rakuten.ne.jp", "766b6c3b2dcff485726370ab3ff886f1s1@im.fw.rakuten.ne.jp", "7691826c7b1e0f698480824017c38ff4s1@pc.fw.rakuten.ne.jp", "76fb0b5eb18d10ecabca388e961398a3s1@pc.fw.rakuten.ne.jp", "77620d84683f5367b8b646914e930b47s1@pc.fw.rakuten.ne.jp", "778a7a0e53e5f6d12d9ed2b09488c994s1@pc.fw.rakuten.ne.jp", "77f67b0087c21b2c581c53f7aa04e5des1@pc.fw.rakuten.ne.jp", "7830083c90a6d203d7118eae70c81bd0s1@km.fw.rakuten.ne.jp", "788ca2317ee8d2ae4ba59b887d3f2199s1@pc.fw.rakuten.ne.jp", "79619e88b88764c4c416ef36dbda2a0ds1@dm.fw.rakuten.ne.jp", "79c01312eae961bc88446518cb328cdes1@km.fw.rakuten.ne.jp", "79c871c04df5d418fc4b16d7a04d830es1@pc.fw.rakuten.ne.jp", "79ca01390a9ac2d78ff305c5f9a5250cs1@pc.fw.rakuten.ne.jp", "7a1b95913fda062122ed62bbaf3871e9s1@pc.fw.rakuten.ne.jp", "7a424af8bf9b4cad88e506a9cdfd66b6s1@km.fw.rakuten.ne.jp", "7a685eabd5685569a4af7c65cb8e24e5s1@pc.fw.rakuten.ne.jp", "7a74de353a3c9af864539c681d9b6941s1@pc.fw.rakuten.ne.jp", "7ac076c5fb436ebaca172d421f28ac9fs1@dm.fw.rakuten.ne.jp", "7b8cc447d251928db684c319cab3946cs1@pc.fw.rakuten.ne.jp", "7b8cfd788fca62745b62da7175d0c2a0s1@pc.fw.rakuten.ne.jp", "7b8d40b772cf82a1fcd5fd33e9d1adccs1@pc.fw.rakuten.ne.jp", "7b963c7ed600cda2c85a360a47eb29e8s1@pc.fw.rakuten.ne.jp", "7bb6d7f1eb100e781517ddd578df8007s1@km.fw.rakuten.ne.jp", "7bcefa8ef46968467b2a18365c29b795s1@pc.fw.rakuten.ne.jp", "7c46f46ca4dd7e28daafda871fde9953s1@pc.fw.rakuten.ne.jp", "7c4b09bcc5a405f5a440155d9e43081es1@pc.fw.rakuten.ne.jp", "7c61796689f1aed0d76b84c3fa1eca1bs1@pc.fw.rakuten.ne.jp", "7cb468e8a054405ca401ac20085bcf7bs1@pc.fw.rakuten.ne.jp", "7d022d49cdcb366b494f4c057676cda3s1@pc.fw.rakuten.ne.jp", "7d22d287a0a9e152034620b7d1d38986s1@km.fw.rakuten.ne.jp", "7d47dc795fdf8e60691110743b2ab402s1@dm.fw.rakuten.ne.jp", "7d4cff098efd528f54d789479711e74ds1@pc.fw.rakuten.ne.jp", "7d6457102b7a78873c92f05a3f255d15s1@pc.fw.rakuten.ne.jp", "7da70e041315e174669fd98c00283e28s1@dm.fw.rakuten.ne.jp", "7e8adfcc3fd3469b5389a832832b332es1@pc.fw.rakuten.ne.jp", "7efbfbef1ac201f2aa161aeb7541c8d1s1@km.fw.rakuten.ne.jp", "7f9914cc2aca44315b613a2f7dc7bb16s1@pc.fw.rakuten.ne.jp", "7fb7d09ec9c3f4069db95cbfa0685142s1@pc.fw.rakuten.ne.jp", "7fd9b8db538b8c8404da679b30b1a4das1@pc.fw.rakuten.ne.jp", "8014258d5aab7d3bc13044cedade51fas1@pc.fw.rakuten.ne.jp", "80664dea131c3c25e636376dccd291a6s1@pc.fw.rakuten.ne.jp", "808749457bc36ed46caf795ffe61868ds1@pc.fw.rakuten.ne.jp", "8087bb66a0acfa7d8b474914b9729300s1@km.fw.rakuten.ne.jp", "811bca7cce8e693019ca0d5467e04263s1@pc.fw.rakuten.ne.jp", "81ad196503fca91a361464ea00d84f2fs1@im.fw.rakuten.ne.jp", "8281665be28a12999beda0ece6b4418cs1@pc.fw.rakuten.ne.jp", "8296ca63d6d14dee61e99b85455814ees1@pc.fw.rakuten.ne.jp", "82c81dcb2c52555fdee2f6e5e6bc9c68s1@pc.fw.rakuten.ne.jp", "82d3c925db36a7268657b9c10ff8f74ds1@pc.fw.rakuten.ne.jp", "82e68d1abffcba9e3e4d723b652f9700sa@pc.fw.rakuten.ne.jp", "83f3691e0e9a0540f3d2c54920d29a51s1@pc.fw.rakuten.ne.jp", "83f95853f65c91d9a6341a811fabde17s1@pc.fw.rakuten.ne.jp", "8497f17879048bc3ddd6a37a0a370335s1@ym.fw.rakuten.ne.jp", "84bcc877d55448046a72435e031b2caes1@km.fw.rakuten.ne.jp", "84d6ff42534ecb771d2294fa842ab627s1@im.fw.rakuten.ne.jp", "84e1150cf458ad87545c043e4801dbbbs1@pc.fw.rakuten.ne.jp", "84e3eddc774bf5ef71b9657c2da0b705s1@pc.fw.rakuten.ne.jp", "8504dd51352ab269128a5ff0d7382cf5s1@dm.fw.rakuten.ne.jp", "853b3a339ab710fa866f98b9ba439ad9s1@pc.fw.rakuten.ne.jp", "854d35f90ed067e0be707a15c2380ba5s1@pc.fw.rakuten.ne.jp", "866dfff4fe0ee05803c0b38f15b72150s1@pc.fw.rakuten.ne.jp", "86a54c1c6431a196857a24e911d054f6s1@pc.fw.rakuten.ne.jp", "86cf78552f5bfed4d27ab3c80d959571s1@pc.fw.rakuten.ne.jp", "8739469955db1f8d5869c660d2cf4875s1@pc.fw.rakuten.ne.jp", "876cf2cd16340097b48482317ca15337s1@pc.fw.rakuten.ne.jp", "87d5b7c89ca1cf40b537c0b641611434s1@km.fw.rakuten.ne.jp", "885298845c2ca2ba5c96077db317d34cs1@km.fw.rakuten.ne.jp", "889fb2be3022882409833499f8eeb848s1@pc.fw.rakuten.ne.jp", "88e34430190a955d6e317414fe3ce3e4s1@pc.fw.rakuten.ne.jp", "88f36e044045e73e1e74032e3cdcc7b8s1@km.fw.rakuten.ne.jp", "89ec71b06077409a4072967a4825cf12s1@ym.fw.rakuten.ne.jp", "8ae64e5e6adca28c8527bb3447dba2f9s1@pc.fw.rakuten.ne.jp", "8b0449c32c41b6a73e548ec00839615as1@pc.fw.rakuten.ne.jp", "8bcf8fb4c17a980f3a8151c113a3667cs1@pc.fw.rakuten.ne.jp", "8c0f64a4792b2772661fc0de29ec0eeas1@im.fw.rakuten.ne.jp", "8c463761adba4a3d49c3a7c490884603s1@pc.fw.rakuten.ne.jp", "8d111b4cd6df06a74212e8925206941es1@pc.fw.rakuten.ne.jp", "8d4530710c324fc694d8740f6ec12132s1@pc.fw.rakuten.ne.jp", "8dcb5d41a398fd8c9cb7a9df85af4ae7s1@pc.fw.rakuten.ne.jp", "8e175299a2ab0ef9bdda82a58ccfb5f6s1@pc.fw.rakuten.ne.jp", "8e19c1dc77d7828ea3a954bd0d9858c5s1@pc.fw.rakuten.ne.jp", "8e7ee165cc732bd875eb76249e097bd8s1@dm.fw.rakuten.ne.jp", "8f135785cb5afd24dfb3dac892554569s1@pc.fw.rakuten.ne.jp", "8febcaa5ff1e5175331320e4a6bec02ds1@dm.fw.rakuten.ne.jp", "909d38c2835e6bd31c5fb1506f826bd0s1@im.fw.rakuten.ne.jp", "90b8da57daf24d24830e6c10cb0c3ebds1@im.fw.rakuten.ne.jp", "90f7b311d0573e1120a175316b9a47e3s1@pc.fw.rakuten.ne.jp", "915dca89f69bb620208d5d5cab164d23s1@pc.fw.rakuten.ne.jp", "91a12422483159d8a760fff9ccf35ff6s1@pc.fw.rakuten.ne.jp", "91c47726d661bec3d524d3abbe5f4b88s1@pc.fw.rakuten.ne.jp", "92049f5c8622d5165e8a5a5b9b28e46ds1@km.fw.rakuten.ne.jp", "921e4b11c40e1bf44e98696b42126182s1@dm.fw.rakuten.ne.jp", "9233c1ebe4425bbe4420cc2583ec6470s1@pc.fw.rakuten.ne.jp", "92b83195599bc6afb3267c25df3a49dcs1@pc.fw.rakuten.ne.jp", "92fdf83acaebe02ee5331e8b57b10f96s1@pc.fw.rakuten.ne.jp", "93045c95e52aecc99955ef563733d0bds1@pc.fw.rakuten.ne.jp", "9369078593316a9f02cb0b6bed4d0dees1@pc.fw.rakuten.ne.jp", "9375bc16ac425252d6192cf25c401416s1@pc.fw.rakuten.ne.jp", "93a1c717f614fdaea975fbfa095f1507s1@pc.fw.rakuten.ne.jp", "93dc2727b62618ae8042d5c84e3af1fesa@pc.fw.rakuten.ne.jp", "9452d8bc9feb3360a7a3f0be26dce169s1@pc.fw.rakuten.ne.jp", "946d467ef45a4478c1b859322c6f82f5s1@pc.fw.rakuten.ne.jp", "94ac889b46e85c0ffeeda0de6509e3afs1@pc.fw.rakuten.ne.jp", "94b9a49f78060b817001e6b7fb3ee6a6s1@pc.fw.rakuten.ne.jp", "95681b5ac4d40eb1e583d77afa6b63dbs1@pc.fw.rakuten.ne.jp", "95b48fda6caf9f72b0a36286825517c0s1@km.fw.rakuten.ne.jp", "95c694ec3ea445ca8aa13546b5887163s1@pc.fw.rakuten.ne.jp", "96272ce8dc5f7d08ae6359cfba32efe2s1@pc.fw.rakuten.ne.jp", "965b2954c2eac5f0400b2f235e8d6e68s1@ym.fw.rakuten.ne.jp", "96771debd0536443304688b08c2d487es1@pc.fw.rakuten.ne.jp", "96f61e23e86fcf07bf8be28d81847de2s1@pc.fw.rakuten.ne.jp", "975d3a4b7c2bad3f733f499f543ed704s1@pc.fw.rakuten.ne.jp", "97ababc7600976254a9e9293b6ed4098s1@pc.fw.rakuten.ne.jp", "987c41e3389343733df559428ff272e5s1@pc.fw.rakuten.ne.jp", "9894f8f0bb13dd8639106923d8f0c8bas1@km.fw.rakuten.ne.jp", "98a0bbae63eca3ef8346b6ed079de927s1@pc.fw.rakuten.ne.jp", "995126e0b9b0baf86b95c5925bf6be5fs1@dm.fw.rakuten.ne.jp", "9a549b860a5431921e861aadc1e58630s1@im.fw.rakuten.ne.jp", "9a5582cb36f92118d72b7f31beb61427s1@pc.fw.rakuten.ne.jp", "9adbbd3a6699945c8c0809c2b5a886cbs1@pc.fw.rakuten.ne.jp", "9af6ece64a0cd057b25c9d01e1819aa4sa@pc.fw.rakuten.ne.jp", "9afa5075aaf37aa57d26b45262c66c2cs1@dm.fw.rakuten.ne.jp", "9b7cf234b3a71d0fcb3f991c8efb9926s1@pc.fw.rakuten.ne.jp", "9bf5a9bfcc127d267481dc334bd7a339s1@pc.fw.rakuten.ne.jp", "9c3b20f1aace8df48d17b50f80863d12s1@pc.fw.rakuten.ne.jp", "9c4c030324613161c26d7af414d68df9s1@km.fw.rakuten.ne.jp", "9c6c4a3f9acd4fd62969cc595ecbaf55s1@pc.fw.rakuten.ne.jp", "9d103ed9f63a62cb3ed4bafabfaa6f15s1@ym.fw.rakuten.ne.jp", "9d5edf4cb339a2ddb5235a00388df7d2s1@km.fw.rakuten.ne.jp", "9d618cb8cae84e2fca6a7b099bbf1c22s1@pc.fw.rakuten.ne.jp", "9d6d6828d3a04bebc3f93e86959abbf3s1@pc.fw.rakuten.ne.jp", "9da59d5aeba568bc2cf8c5bb5c230e40s1@pc.fw.rakuten.ne.jp", "9dc8f01f5372aefa77c622af827c4a98s1@pc.fw.rakuten.ne.jp", "9dd9d322d102fbb0f430ff70d413edb5s1@pc.fw.rakuten.ne.jp", "9e10233755feac7f38566dab52222568s1@pc.fw.rakuten.ne.jp", "9e323af3e354e14aefe7156023c779fds1@pc.fw.rakuten.ne.jp", "9e72d44d4bd96b588a4a95d0354688b4s1@pc.fw.rakuten.ne.jp", "9ea0bb93734c88186307e0a7d628c00cs1@pc.fw.rakuten.ne.jp", "9edd71a88df7240ed9c0977fe852e24fs1@pc.fw.rakuten.ne.jp", "9f6d5247a02a12a54e1407ad22990fdcs1@km.fw.rakuten.ne.jp", "9f8a3e0c272fd2c76d341f07d85ad52cs1@dm.fw.rakuten.ne.jp", "9fe421105453cfafefca63c9e3ccf586s1@km.fw.rakuten.ne.jp", "9ff28007f4e7caed679588dc40a818ffs1@pc.fw.rakuten.ne.jp", "a0bb0be4ad25e198c0e9fd7e8836dad3s1@pc.fw.rakuten.ne.jp", "a0c1d40375408b9031ff673bbbb276f7s1@pc.fw.rakuten.ne.jp", "a0c7a0ee53e41b260fe06a3228289667s1@pc.fw.rakuten.ne.jp", "a123ad9343b6a0b273690de8b2bb5073s1@pc.fw.rakuten.ne.jp", "a166a3617f6e309f3bcdc63c4a1572c4s1@pc.fw.rakuten.ne.jp", "a17da1c876a85c67c3e73d813f5589bas1@dm.fw.rakuten.ne.jp", "a1be9a1d5d8bea31b158814795311c4as1@pc.fw.rakuten.ne.jp", "a2227a9d1a6297eddd4f728dc1e2b92bs1@pc.fw.rakuten.ne.jp", "a2575ca04835699dee6a79cf32e90f71s1@pc.fw.rakuten.ne.jp", "a2d338ebae47df6ed5737261fc5e658es1@pc.fw.rakuten.ne.jp", "a320a1e65c34fd04e564c6d8f119654fs1@pc.fw.rakuten.ne.jp", "a381c2c42994f970ce436fed1dfbd8e6s1@pc.fw.rakuten.ne.jp", "a388e350758a3a4267a9198f87b2bd59s1@dm.fw.rakuten.ne.jp", "a3b8f6c1fb35f459db02364031a62776s1@pc.fw.rakuten.ne.jp", "a3dc989efdec8bcceb47915f5bab07ces1@pc.fw.rakuten.ne.jp", "a4207075450ef7a2456b97218d7617f6s1@pc.fw.rakuten.ne.jp", "a43572d2a1b33bc885b47825c7098235s1@km.fw.rakuten.ne.jp", "a48d736754ce55b029d7d71a3f266ac0s1@pc.fw.rakuten.ne.jp", "a4ab702c459de2ec5eff633db1f69fc2s1@km.fw.rakuten.ne.jp", "a4e9bd707ab8f69350234715a1dcf845s1@pc.fw.rakuten.ne.jp", "a51a7353567f1bfaeebfb0f2b2ba41fbs1@dm.fw.rakuten.ne.jp", "a583c438bdfb82ff08a87bd294f235d7s1@pc.fw.rakuten.ne.jp", "a58806eee6d47611158195c50983eeebs1@pc.fw.rakuten.ne.jp", "a5ca2b968114a4fcfa75099ddb136315s1@pc.fw.rakuten.ne.jp", "a64fa4a28669d38e3be88bcb14341c6fs1@pc.fw.rakuten.ne.jp", "a67a25a7ee733d2ca6de8ac7b8262fc0s1@pc.fw.rakuten.ne.jp", "a69b23edfa3816bb41873bfb36f785b1s1@pc.fw.rakuten.ne.jp", "a6cb53a53dab752b235debac7f4af0d0s1@pc.fw.rakuten.ne.jp", "a714759052b9af4cfc8a295209ef8d5es1@pc.fw.rakuten.ne.jp", "a79e52bb79d18f05f81520fec37d29bas1@pc.fw.rakuten.ne.jp", "a7a4a3d004aea40b7fa3fc7f4b958a6fs1@pc.fw.rakuten.ne.jp", "a7e64308c6c0ccd66ac9d9c0d1dac128s1@pc.fw.rakuten.ne.jp", "a7fcaf6e59aa75ec0224f7c4d409ea5fs1@pc.fw.rakuten.ne.jp", "a80c65d015fa554f33072e9c1114c068s1@pc.fw.rakuten.ne.jp", "a83f92e51298060f88b51f466cf15ed8s1@pc.fw.rakuten.ne.jp", "a85d042e85e262c6766734b4daa706e8s1@ym.fw.rakuten.ne.jp", "a86a7906b3671832317c75ae6e40d5d2s1@km.fw.rakuten.ne.jp", "a9c4b83168f80830e223d293a42bda28s1@pc.fw.rakuten.ne.jp", "a9e50b36a34474cc8b5916d07231d92es1@pc.fw.rakuten.ne.jp", "aa6c60ef8ce7df24df5f815afb21dbe4s1@pc.fw.rakuten.ne.jp", "aab69a3510e06e374ef98e7c937da0eft1@dm.fw.rakuten.ne.jp", "aadea808fcc190997801e2641f3a32a5s1@km.fw.rakuten.ne.jp", "aaef3b65b490ee480f3f22993d3e756cs1@dm.fw.rakuten.ne.jp", "ab6e5160857d8fa1211b8619a869d7d1s1@dm.fw.rakuten.ne.jp", "aba6dbed8f1a283677e608ab35bae782s1@pc.fw.rakuten.ne.jp", "ac284057da52e3cf4273e17f89103463s1@pc.fw.rakuten.ne.jp", "ac593456a022da472d325396007f5604s1@pc.fw.rakuten.ne.jp", "ac66ab80f86b0ee0170a718cf16a9ca2s1@pc.fw.rakuten.ne.jp", "aca9b69b04a4983487548d0db3db01acs1@dm.fw.rakuten.ne.jp", "acd5925daed5c1cd9ff7c9ada0923370s1@pc.fw.rakuten.ne.jp", "ad2e0aaafe9d9db3e230bc0cc33f21e4s1@pc.fw.rakuten.ne.jp", "ad413b5bf4ff9ecb433e0157e80d03a0s1@pc.fw.rakuten.ne.jp", "ad6f481e28e163d97cfbf5c7747c8b66sa@pc.fw.rakuten.ne.jp", "ad7e68bfeb7dd0d8daa985a71311345ds1@pc.fw.rakuten.ne.jp", "aed28d155ddb389e9519a965906a78c1s1@pc.fw.rakuten.ne.jp", "aefd71ac743c1dd0e56fab54017efcbds1@pc.fw.rakuten.ne.jp", "af475dd56725fedf188bf5e7f9fab497s1@pc.fw.rakuten.ne.jp", "af8652b0ff5e670b6eba6a7df2ba1efes1@pc.fw.rakuten.ne.jp", "afa0db6daa0503af6498b8e65bf8863ds1@dm.fw.rakuten.ne.jp", "b02a7ddea2bcc1587ebedb02ec6598bfsa@pc.fw.rakuten.ne.jp", "b04660ba70bea69af37f3b652474a7acs1@pc.fw.rakuten.ne.jp", "b09e7fec814a52ca654046192183a2a9s1@pc.fw.rakuten.ne.jp", "b0c73e0d6e2313a3de3596e1254965ffs1@pc.fw.rakuten.ne.jp", "b1160fc70251fb41335e0a1e3b815532s1@pc.fw.rakuten.ne.jp", "b192c3057a5ff280a103ce53bea79626s1@pc.fw.rakuten.ne.jp", "b1a90976ccec7eddf9964b91c463f008s1@pc.fw.rakuten.ne.jp", "b21c2901e4fa20e019cdcd7fe2c514bcs1@dm.fw.rakuten.ne.jp", "b2ca840b3a269a90ffdf8b8df5955d6ds1@pc.fw.rakuten.ne.jp", "b2d50aefe37a03185507b3c70656075fs1@pc.fw.rakuten.ne.jp", "b35409af1ddd7b72ec8c4df88513f7a1s1@pc.fw.rakuten.ne.jp", "b3963bc4203cb0316630dc2157478a48s1@pc.fw.rakuten.ne.jp", "b3a066e332c2c43fb90f8ea9a4f620ces1@pc.fw.rakuten.ne.jp", "b45dfbe0bf5da2004159be8bb9d19b76s1@pc.fw.rakuten.ne.jp", "b4d162cdf10545674c16b7bd5042853ds1@pc.fw.rakuten.ne.jp", "b4e27a3af7b2d90a94fa78da6e41f768s1@pc.fw.rakuten.ne.jp", "b4e4b84acaaef1931add231202597ca9s1@km.fw.rakuten.ne.jp", "b5318c6e6342947c415ab8fe0725b4b4s1@pc.fw.rakuten.ne.jp", "b5371ee1d2d39e57efb777f8196d6e03s1@pc.fw.rakuten.ne.jp", "b58f43a3b0ab1b38af67e0aea13bf3des1@km.fw.rakuten.ne.jp", "b5abe6322c4503a4eef87f4579cdaf45s1@pc.fw.rakuten.ne.jp", "b66cdf108cc4456f24b1c92388cb3872s1@km.fw.rakuten.ne.jp", "b77e9fa98771ab2c950f83f5dc68ef63s1@pc.fw.rakuten.ne.jp", "b7c31b2d61a75ce0a8eaa4fdf8386250s1@pc.fw.rakuten.ne.jp", "b854f06dd46914eacf2906b77fd78859s1@im.fw.rakuten.ne.jp", "b89cc56bd07744d87a4f8e8812a9a18ds1@pc.fw.rakuten.ne.jp", "b8a7b712050842027a62b388b8395548s1@pc.fw.rakuten.ne.jp", "b8f291abf49631a573a62b84d3607b68s1@dm.fw.rakuten.ne.jp", "b900cfdd49e8ab6e6291ca87b5e879f1s1@km.fw.rakuten.ne.jp", "b9469186d67d563f13b7c3943d60c70bs1@km.fw.rakuten.ne.jp", "b9bd6ac5c97c63a4974e60ac928542a0s1@dm.fw.rakuten.ne.jp", "ba525bb55c5f5b981c6a349f8f536e9as1@pc.fw.rakuten.ne.jp", "ba7aadfa71d905a5b9cd88ec8c633e7bs1@pc.fw.rakuten.ne.jp", "babb145901b9c97bfa1b3bae731996f6s1@pc.fw.rakuten.ne.jp", "bad4b838240702b0169ebaf35ff7bd4es1@pc.fw.rakuten.ne.jp", "bb5355ccbf2c53b149fe6c8575a6a6cbs1@pc.fw.rakuten.ne.jp", "bb53568fd5274ce5cf65d6d726fca0b7s1@pc.fw.rakuten.ne.jp", "bb946317f450245a8864b7c80eb7e8dds1@pc.fw.rakuten.ne.jp", "bbc24a1d872c325b96378e8b1b884644s1@pc.fw.rakuten.ne.jp", "bbe1cc51ff0fc047ead92706bda22721s1@pc.fw.rakuten.ne.jp", "bc258a4f82ea457a956a57fbfdb9bf99s1@pc.fw.rakuten.ne.jp", "bc4e9a28ba8aed8b5e7588833caecaaes1@pc.fw.rakuten.ne.jp", "bd5a537298eeeb35b35468f97d170c06s1@pc.fw.rakuten.ne.jp", "bd7c6e7d657a8a5eb0e6c3b119be1369s1@pc.fw.rakuten.ne.jp", "bd9d2b46b58812beaf657c736d12f021s1@pc.fw.rakuten.ne.jp", "be6618ebee566232453e8ed7c92d5bb3s1@pc.fw.rakuten.ne.jp", "bf5f2cc7e23d8fb9c1470b73db701aces1@pc.fw.rakuten.ne.jp", "bf6bc23c099470bb9b4d68afe9923f77s1@pc.fw.rakuten.ne.jp", "bf8ad1402264b7a2c6650e8f23bb3133s1@pc.fw.rakuten.ne.jp", "c1192503bb4821a63955c8b2400da148s1@pc.fw.rakuten.ne.jp", "c1abc227589bca3ca264328847573310s1@pc.fw.rakuten.ne.jp", "c1d6e0128d4469445d57668f3460aba0s1@pc.fw.rakuten.ne.jp", "c1dd37569a11ef8dce182e32b021d34fs1@pc.fw.rakuten.ne.jp", "c31d04d3bae71b4ef310922fe55073b5s1@pc.fw.rakuten.ne.jp", "c3382023cc9d3cccbf05b548d8375c94s1@pc.fw.rakuten.ne.jp", "c35296f8887eb93cc164ebeaa05ecd4ds1@pc.fw.rakuten.ne.jp", "c39836575976954973161fb868a0f243s1@dm.fw.rakuten.ne.jp", "c41a4c79c43691d0e203afd583d4bdecs1@pc.fw.rakuten.ne.jp", "c4482ef3457d77e18714504baa808f50s1@pc.fw.rakuten.ne.jp", "c45eb5b6c99f153adb26bf2aca6d426as1@dm.fw.rakuten.ne.jp", "c47502433220eb75319b8495322b4523s1@km.fw.rakuten.ne.jp", "c50c141652882f15746aa0e5418a61b9s1@pc.fw.rakuten.ne.jp", "c5396b22ff84683beacfab849bbd9e3esa@km.fw.rakuten.ne.jp", "c5435aa68c210b063218e9e86a91b6a4s1@pc.fw.rakuten.ne.jp", "c55805e67edb10deee45b6e83f0f73fas1@pc.fw.rakuten.ne.jp", "c57c62f8abdb4ad58a0f8b61e406c68es1@pc.fw.rakuten.ne.jp", "c590e1c96ff19073c317de4478236809s1@pc.fw.rakuten.ne.jp", "c5b829f5817f687fe22a6a5b4101f1ces1@pc.fw.rakuten.ne.jp", "c5c8ac159c58cd4dec79c5c9e406e6f3s1@dm.fw.rakuten.ne.jp", "c64b897ad8d036aa011a5507a46b40e7s1@pc.fw.rakuten.ne.jp", "c679bb83df3dfd825c8ef48c794db7ccs1@km.fw.rakuten.ne.jp", "c6a50f689d2d6380d8623f8601cf3c7es1@pc.fw.rakuten.ne.jp", "c6fd2687d3d4beae5f7aa3713afa8c8cs1@pc.fw.rakuten.ne.jp", "c750038a61775ea44605870c10868a69s1@pc.fw.rakuten.ne.jp", "c81b5e276f6a6e440dc5c8a4934546c1s1@pc.fw.rakuten.ne.jp", "c84b9c66e17264c4bfbf74fa734297f7s1@ym.fw.rakuten.ne.jp", "c88f12bd3081db661f2fd837efb3b612s1@pc.fw.rakuten.ne.jp", "c905e7b7d0a10ed62b8118b9fb6ff5ffs1@pc.fw.rakuten.ne.jp", "c95cc96c51c4ee2830adbddeff9bcab9s1@pc.fw.rakuten.ne.jp", "c96392284584bdb30ae7daeeb17d5240s1@pc.fw.rakuten.ne.jp", "c990b9e4fff9aa25448df7308829b5a8s1@pc.fw.rakuten.ne.jp", "c99b2536e005135a9c53a9b07b38fe03s1@pc.fw.rakuten.ne.jp", "ca60a308483f208d28c29f237b106e3cs1@ym.fw.rakuten.ne.jp", "ca6e5b3562d842a753d8b06cede6c558s1@pc.fw.rakuten.ne.jp", "ca8a9903dfe41c015c5ffd76377bb6f9s1@pc.fw.rakuten.ne.jp", "cad5e454a71dd76106d9deee15b52980s1@dm.fw.rakuten.ne.jp", "cb7e051316c6faef0a8fcd4ef9929bcfs1@pc.fw.rakuten.ne.jp", "cc45f83a4e1b14eaae5b6033adf37090s1@pc.fw.rakuten.ne.jp", "ccb9f9328ee267bb295992ac12b6dbb2s1@dm.fw.rakuten.ne.jp", "ccc1b7982bf47a144c9f9885bc9555d1s1@pc.fw.rakuten.ne.jp", "cce221e3cb2beaa25da4e07c477bcfc6s1@dm.fw.rakuten.ne.jp", "cceaafa885fcd9dcb9f0d03d2e7a9114s1@pc.fw.rakuten.ne.jp", "cd2510d01044a7455b2485d614e9ffa8s1@pc.fw.rakuten.ne.jp", "cd3a40a952abaf70628ee54c0c2f7f37s1@pc.fw.rakuten.ne.jp", "cd829987d48cb58c0df06aa8ce1ad4abs1@pc.fw.rakuten.ne.jp", "ce5a63aafb912a07586267601607bd8bs1@km.fw.rakuten.ne.jp", "ce85dfd3f43c2e0e2af1c7cf08e2d1a4s1@km.fw.rakuten.ne.jp", "ceb07d66a696228db6c777a19533df0es1@im.fw.rakuten.ne.jp", "cefd369efe0fe2d60186bae5546ce758s1@pc.fw.rakuten.ne.jp", "cf322fe343e94831d5c47b1fc8b5b068s1@dm.fw.rakuten.ne.jp", "cf7d7eb13bb0138e5ab8fde3a4b31d75s1@km.fw.rakuten.ne.jp", "cf8b6e1fbd016d6fb0ebb5ed0d61e8bcs1@pc.fw.rakuten.ne.jp", "d076b41fc24b07ef48cb7afbf813d5fbs1@pc.fw.rakuten.ne.jp", "d13b0592032c873a03d287975d8752c8s1@pc.fw.rakuten.ne.jp", "d15a8bdbb196a21018583609d88b0028s1@pc.fw.rakuten.ne.jp", "d1c38b95cf3e7c9a281cb600780b98c5s1@pc.fw.rakuten.ne.jp", "d259edda9138194631e0ce929a14db75sa@pc.fw.rakuten.ne.jp", "d2c784aa46d5b2bed969220065efdf4es1@km.fw.rakuten.ne.jp", "d39193e01d4eff6df7e8ba4c5e2d6b6as1@pc.fw.rakuten.ne.jp", "d3b65fea8776e0bc9993d852557f1e04s1@km.fw.rakuten.ne.jp", "d44630a487d4570f1950ff3ea6c9dfbcs1@pc.fw.rakuten.ne.jp", "d4a4db727965dd7bb82a1557ca03cdc3sa@pc.fw.rakuten.ne.jp", "d576dba794bf1f78393eec9dd32904d1s1@pc.fw.rakuten.ne.jp", "d5d611d3dc103c4ba1f36d06bacc0b42s1@pc.fw.rakuten.ne.jp", "d5d790b4ebfe10ef1c69e0617470b3d8s1@im.fw.rakuten.ne.jp", "d5eb5b376c4459cd88e9e5e65184a72bs1@pc.fw.rakuten.ne.jp", "d670f1ed73d833407042e46ccb2ecc04s1@im.fw.rakuten.ne.jp", "d697a4aa449326722875c62d01c1ada1s1@pc.fw.rakuten.ne.jp", "d71bf3410134aa252592fe7f2e6fe08cs1@pc.fw.rakuten.ne.jp", "d7642aaff5e225ed2cc1c7c52b09dc98s1@pc.fw.rakuten.ne.jp", "d7c1a0c59efb6309d974cddc682c577cs1@pc.fw.rakuten.ne.jp", "d7e842a1b327a67f6f268845c4c673c0s1@pc.fw.rakuten.ne.jp", "d83779c5756e433d155a87a9fc66aa54s1@pc.fw.rakuten.ne.jp", "d8916e6568e122020c80b47c5283bf01s1@pc.fw.rakuten.ne.jp", "d8a0a3787bef8c6a9e25802f39cc7fa0s1@pc.fw.rakuten.ne.jp", "d8ea8264d7334957555f65b813037f62s1@km.fw.rakuten.ne.jp", "d902da8048e7b90f56e7fab65c16d773s1@pc.fw.rakuten.ne.jp", "d963b7b6c2f47bd10d7178dc5933eeffs1@dm.fw.rakuten.ne.jp", "da49725521d7b82e8778088e00b47fc6s1@pc.fw.rakuten.ne.jp", "da9b845608c3345fd070923b65c33aaas1@km.fw.rakuten.ne.jp", "daa74de37dc538bd11c931c10e66e00fs1@dm.fw.rakuten.ne.jp", "dafa6e75baad1fbb47771adf6c7ec275s1@pc.fw.rakuten.ne.jp", "db212b2bd847edb62fdc2b08eedc517as1@pc.fw.rakuten.ne.jp", "dc3dec58087bcd38569c945c43fa76d1s1@pc.fw.rakuten.ne.jp", "dc5b6461aa47cd1dc799d0adb7e4a4cas1@pc.fw.rakuten.ne.jp", "dc88d24e7abc3d29800d2a09c74f635bs1@dm.fw.rakuten.ne.jp", "dca0662379074d948e4fbe47def4f5c5s1@pc.fw.rakuten.ne.jp", "dd7270cfb8ee8c33686c6dd38e238309s1@pc.fw.rakuten.ne.jp", "de2744e429fddc8f1c1e30488ce10bbfs1@pc.fw.rakuten.ne.jp", "de9d43dcf3968b6752a7afc3e4aa754es1@dm.fw.rakuten.ne.jp", "dea4ed65878956969b250ca1b1604841s1@pc.fw.rakuten.ne.jp", "dfe657f2bbe49f41c3f543a8c0cb2bbas1@pc.fw.rakuten.ne.jp", "e016200f202318d0248aac45b1153fe3s1@km.fw.rakuten.ne.jp", "e027de619fa512d5a5c957115f815560s1@pc.fw.rakuten.ne.jp", "e02c3343903a13839a566050363d50d4s1@pc.fw.rakuten.ne.jp", "e05463a7114afc0e2e0d7fc230920968s1@pc.fw.rakuten.ne.jp", "e09e39b9f3270003c1e0fd5fcab6bb41s1@pc.fw.rakuten.ne.jp", "e12e42942bde227382dcdf26223a4ab6s1@dm.fw.rakuten.ne.jp", "e1639fd61a59399bac2cf4a74b8b3618s1@pc.fw.rakuten.ne.jp", "e166afec959edb85e3bba0584d58886es1@pc.fw.rakuten.ne.jp", "e19b25af2ac161e2427ed022d44ce0c7s1@pc.fw.rakuten.ne.jp", "e23c231456aed5bd6478876f7322b458s1@pc.fw.rakuten.ne.jp", "e2784d372936735995b9318e51b2619ds1@km.fw.rakuten.ne.jp", "e27ecadce2afc408e92a4e2c2bb3f653s1@pc.fw.rakuten.ne.jp", "e28bf905752db6665b8c59bdefed7bfds1@pc.fw.rakuten.ne.jp", "e294c11ee1bf9e6ed4199d026e7bdd5bs1@dm.fw.rakuten.ne.jp", "e2c475b8ed9ec07741e7fdad67b05682s1@pc.fw.rakuten.ne.jp", "e2d01430e2165a9d607604ee7257798fs1@dm.fw.rakuten.ne.jp", "e315465f33727ad89c974075bda3c81cs1@pc.fw.rakuten.ne.jp", "e3285114af834cde32042845f86ac706s1@km.fw.rakuten.ne.jp", "e441a043822e5e58ccec1345dec322a4s1@pc.fw.rakuten.ne.jp", "e465882ea1759a0eccc2f85ed7d654fcs1@pc.fw.rakuten.ne.jp", "e4afcecc1510443a21504b0284f4e5f3s1@pc.fw.rakuten.ne.jp", "e4c9d5200688d38336ca907a56aaa3c6s1@pc.fw.rakuten.ne.jp", "e4ce84bb9546c79e03a4cf7c3bf6cf88s1@pc.fw.rakuten.ne.jp", "e56e2c4d1a500676dda2d45a09ec2a2fs1@pc.fw.rakuten.ne.jp", "e62a4b243b509cfff36f1e24cbf623d0s1@pc.fw.rakuten.ne.jp", "e6abbd4cccf61bf8db3fcf0c015059a0s1@pc.fw.rakuten.ne.jp", "e778684f9e73b87eaf0b7074f70a57a2s1@pc.fw.rakuten.ne.jp", "e7b14038897a8837971ed9e1c3327361s1@dm.fw.rakuten.ne.jp", "e8691585c371fa93104e17bab274ccbfs1@pc.fw.rakuten.ne.jp", "e893c30e5950b138b7c124cd5ba6db8bs1@pc.fw.rakuten.ne.jp", "e8cfe6af3fbcbcbee6648d4d2f86ddccs1@pc.fw.rakuten.ne.jp", "e8d66084baa1bd7d918c810327255110s1@km.fw.rakuten.ne.jp", "e903d315798a5ce78ea52d2d2baef772s1@pc.fw.rakuten.ne.jp", "e9a269bdbfc0ec49b6c80a203d7baf03s1@pc.fw.rakuten.ne.jp", "e9a304737859531f8d07f0a4de6510dbs1@km.fw.rakuten.ne.jp", "e9dba2bcaa83ecd333da64fca4be3e57s1@pc.fw.rakuten.ne.jp", "e9e4595487aea051d6fde091470646b2s1@ym.fw.rakuten.ne.jp", "ea1b637a5eb442837e6e22e3d4539b93s1@pc.fw.rakuten.ne.jp", "ea232eaf6a13d5d790c9b7212fa0b6e4s1@pc.fw.rakuten.ne.jp", "eac7876beac1ded3ee3076eda65dbae0s1@pc.fw.rakuten.ne.jp", "eaceace6293fe1cbf3b13de0062b02afs1@pc.fw.rakuten.ne.jp", "eadb340e149d3f2c36fd16c87d8b52d1s1@pc.fw.rakuten.ne.jp", "ebf47936925835e4f1b6a4b2ed8cf7efs1@pc.fw.rakuten.ne.jp", "ed6007836001ba9a2f83f7549e84c11bsa@im.fw.rakuten.ne.jp", "ed8839b490b91608ac039d9a8107d447s1@dm.fw.rakuten.ne.jp", "ed92cc18812a8f5429ac489c196fe076s1@pc.fw.rakuten.ne.jp", "ed99f9c1d70b905a394cd57cbb65f255s1@dm.fw.rakuten.ne.jp", "ee589c19c9fbb5812369e048aac59ebas1@im.fw.rakuten.ne.jp", "ee5919427bd198ebcb753c830e6af41bs1@pc.fw.rakuten.ne.jp", "eeab5bf22cf51f6b58292363b51c1810s1@pc.fw.rakuten.ne.jp", "eefcecb203fc862abb6292b3320e12a1s1@km.fw.rakuten.ne.jp", "ef1de139813d5a906f0d867980180f36s1@pc.fw.rakuten.ne.jp", "ef30fad0a2956fafee18c9dc57eeff25s1@dm.fw.rakuten.ne.jp", "ef4e4c21b3471a18a5faf83d516debabs1@pc.fw.rakuten.ne.jp", "ef581944d225f17e713bd0673626a47ds1@km.fw.rakuten.ne.jp", "f04284394793423820a6be7c479f9a83s1@km.fw.rakuten.ne.jp", "f11dba10c8fe63634c83c359f9a785ees1@pc.fw.rakuten.ne.jp", "f22784a44d8450e1904367b6e97f0ba7s1@km.fw.rakuten.ne.jp", "f2e21d55c7318fc69d2b43f87ba45e62s1@pc.fw.rakuten.ne.jp", "f2e6001fa7578f1269cfd6f8d9cdcf68s1@pc.fw.rakuten.ne.jp", "f3f7767e440e7e6bfcfe2c8e4dc79683s1@pc.fw.rakuten.ne.jp", "f3f7996a5c4cf2b3963abbd6a276ee59s1@pc.fw.rakuten.ne.jp", "f43b28e610d6097bf000c9924f21bd51s1@pc.fw.rakuten.ne.jp", "f46f8aca5ead50c591e022cae510707as1@pc.fw.rakuten.ne.jp", "f47227c832130caf365f59b401aa69b8s1@pc.fw.rakuten.ne.jp", "f5098901d83a22b9baa8410fcc11d94as1@pc.fw.rakuten.ne.jp", "f55cd8429288893d6e6cca3e7e11350es1@dm.fw.rakuten.ne.jp", "f5c8c02b276d2f68c3ba9922e00045bcs1@pc.fw.rakuten.ne.jp", "f5e72f48782cf8057504917ca068e305s1@pc.fw.rakuten.ne.jp", "f627b390bd5af5829c987109cae4ece8s1@pc.fw.rakuten.ne.jp", "f6659e97e7f9480e1cec61527c1f791bs1@pc.fw.rakuten.ne.jp", "f6e25d321b38d20b1157829d40d62478s1@pc.fw.rakuten.ne.jp", "f6f85f98a7f01ffd3079997717bdf41as1@dm.fw.rakuten.ne.jp", "f72bef1dc1f0bc453b7bc0c7f9989754s1@pc.fw.rakuten.ne.jp", "f74097189607cdfdd02249c2f2d834ces1@pc.fw.rakuten.ne.jp", "f796752cf4a7731fdfbe39112d88bbffs1@km.fw.rakuten.ne.jp", "f853b35e179a591b3ebf5d84a777d22bs1@pc.fw.rakuten.ne.jp", "f8e88e4c60a5054a2b2edd35f688990cs1@pc.fw.rakuten.ne.jp", "f965f5db86d293ab7a98478f062e83f9s1@pc.fw.rakuten.ne.jp", "f99533915734523c641eeb23c8fff995s1@dm.fw.rakuten.ne.jp", "f9bc52bd14508219f8654823149f8c0fs1@pc.fw.rakuten.ne.jp", "f9c179ddf86c982a5c1b1be2962c5d92s1@pc.fw.rakuten.ne.jp", "f9cc980c8e860adc25b52c750128bd09s1@km.fw.rakuten.ne.jp", "f9ea95191c4ba75a0f1e3aa5d27ad227s1@pc.fw.rakuten.ne.jp", "fa044452927ba95272873cd349da14e5s1@pc.fw.rakuten.ne.jp", "fa1ea8b880fb348db786f32464664794s1@im.fw.rakuten.ne.jp", "fa34448d23b79cadd9e652f7910d5118s1@pc.fw.rakuten.ne.jp", "fa51d51f821127e67e6e2ecf7f68e126s1@km.fw.rakuten.ne.jp", "fbf47a9e63612afb4bf89c7d57df3283s1@im.fw.rakuten.ne.jp", "fc00722db3ade54e455313770a9f62a0s1@pc.fw.rakuten.ne.jp", "fc637f89e82aef7493d99c77ed46a2b2sa@pc.fw.rakuten.ne.jp", "fc787d12f784e2562e14c464f6bb84d7s1@pc.fw.rakuten.ne.jp", "fc83e9281adbb4515bcda8acfb174f5as1@pc.fw.rakuten.ne.jp", "fd5833ccca9a52fb88a4d07f4a508011s1@pc.fw.rakuten.ne.jp", "fd6b7b0bddfe15d46e392c446580e898s1@pc.fw.rakuten.ne.jp", "fe02761df7a9c94dd2e212bbf14f4f1fs1@pc.fw.rakuten.ne.jp", "ff04c3e6dd1913e573ab9daaf2e45510s1@pc.fw.rakuten.ne.jp", "ff7bbde428b7471cb70f7beaf989bf36s1@km.fw.rakuten.ne.jp"
    };
    private final int[] orderProgressComm = new int[]{200, 300, 500, 600, 700, 800, 900};
    private final String[] orderProgressUnComplete = new String[]{"200", "300", "800"};
    private final int[] orderProgressUnConfirm = new int[]{100};
    private final String orderType1 = "1";
    private final String orderType3 = "3";
    @Autowired
    private ShopDao shopDao;
    @Autowired
    private UserDao userDao;
    @Autowired
    private ShipPriceService shipPriceService;
    @Autowired
    private StorageDao storageDao;
    @Autowired
    private StockRecordDao stockDao;
    @Autowired
    private CompanyDao companyDao;
    @Autowired
    private JpRegionService mRegionService;
    @Autowired
    private MailSenderService mailService;
    @Value("${gbc.template.filePath}")
    private String templatePath;
    @Autowired
    private OrderRakutenShippingDao rakutenShippingDao;
    @Autowired
    private RedisTemplate redisTemplate;
    private List<String> sendMailStr = new ArrayList<>();
    private String RakutenInvitationSetKey = "rakuten_invitation_key_set";
    @Autowired
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    @Autowired
    private OrderRakutenCouponDao rakutenCouponDao;

    @Override
    public SingleResult addInit() {
        return SingleResult.success("");
    }

    @Override
    public Object add(Object req, Long userId) {
        OrderRakutenDo entityDo = new OrderRakutenDo();
        BeanUtils.copyProperties(req, entityDo);
        handlerAddBefore(entityDo, userId);
        dao.insert(entityDo);
        return handlerAddAfter(entityDo);
    }

    //新增校验
    private void addCheck(Object req) {

    }

    //做新增之前要执行的业务定制处理
    private void handlerAddBefore(OrderRakutenDo entityDo, Long userId) {
//        entityDo.setCreateBy(userId);
//        entityDo.setCreateTime(new Date());
//        entityDo.setDeleteFlag(SysConstant.DELETE_FLAG_FALSE);
    }

    //将新增的do转换成要返回的实体
    private Object handlerAddAfter(OrderRakutenDo entityDo) {
        Object res = new Object();
        BeanUtils.copyProperties(entityDo, res);
        return res;
    }

    @Override
    public SingleResult updateInit(Long id) {
        return SingleResult.success("");
    }

    @Override
    public Object update(Object req, Long userId) {
        /*OrderRakutenDo entityDo = dao.selectById(req.getId());
        BeanUtils.copyProperties(req, entityDo);
        handlerUpdateBefore(entityDo, userId);
        dao.updateById(entityDo);
        return handlerUpdateAfter(entityDo);*/
        return null;
    }

    //编辑校验
    private void updateCheck(Object req) {

    }

    //做修改之前要执行的业务定制处理
    private void handlerUpdateBefore(OrderRakutenDo entityDo, Long userId) {

    }

    //做修改之后要执行的业务定制处理
    private Object handlerUpdateAfter(OrderRakutenDo entityDo) {
        Object res = new Object();
        BeanUtils.copyProperties(entityDo, res);
        return res;
    }

    @Override
    public int delete(Long id, Long userId) {
        OrderRakutenDo entityDo = dao.selectById(id);
        handlerDeleteBefore(entityDo, userId);
        return dao.deleteById(id);
    }

    //做删除之前要执行的业务定制处理
    private void handlerDeleteBefore(OrderRakutenDo entityDo, Long userId) {

    }

    @Override
    public OrderRakutenDetailResponse detail(Long id) {
        OrderRakutenDo entityDo = dao.selectById(id);
        if (entityDo == null) {
            throw new BizException(SysConstant.Error_Data_NotExist);
        }
        OrderRakutenDetailResponse res = new OrderRakutenDetailResponse();
        BeanUtils.copyProperties(entityDo, res);
        return handlerDetailAfter(res);
    }

    @Override
    public OrderRakutenDetailResponse detail(String orderNumber) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("order_number", orderNumber);
        OrderRakutenDo entityDo = dao.selectOne(wrapper);
        OrderRakutenDetailResponse res = new OrderRakutenDetailResponse();
        BeanUtils.copyProperties(entityDo, res);
        return handlerDetailAfter(res);
    }

    //查询明细之后要执行的业务定制处理
    private OrderRakutenDetailResponse handlerDetailAfter(OrderRakutenDetailResponse res) {
        QueryWrapper packageWrapper = new QueryWrapper();
        packageWrapper.eq("order_id", res.getId());
        List<OrderRakutenPackageDo> packageDoList = packageDao.selectList(packageWrapper);
        List<OrderRakutenPackageResponse> packageResponsesList = new ArrayList<>();
        for (OrderRakutenPackageDo packageDo :
                packageDoList) {
            OrderRakutenPackageResponse packageResponse = new OrderRakutenPackageResponse();
            BeanUtils.copyProperties(packageDo, packageResponse);
            QueryWrapper productWrapper = new QueryWrapper();
            productWrapper.eq("basket_id", packageResponse.getBasketId());
            List<OrderRakutenProductDo> productDoList = productDao.selectList(productWrapper);
            List<OrderRakutenProductResponse> productResponseList = new ArrayList<>();
            packageDao.selectList(packageWrapper);
            for (OrderRakutenProductDo productDo :
                    productDoList) {
                OrderRakutenProductResponse productResponse = new OrderRakutenProductResponse();
                BeanUtils.copyProperties(productDo, productResponse);
                productResponseList.add(productResponse);
            }
            packageResponse.setProductResponseList(productResponseList);
            packageResponsesList.add(packageResponse);
        }
        res.setPackageResponseList(packageResponsesList);

        LambdaQueryWrapper<OperateRecordDo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(OperateRecordDo::getThirdId, res.getId()).eq(OperateRecordDo::getType, 5).orderByDesc(OperateRecordDo::getId);
        List<OperateRes> operateResList = operateRecordDao.getOperateList(res.getId(), 5);
        res.setOperateResList(operateResList);

        return res;
    }

    @Override
    public SingleResult pageInit() {
        return SingleResult.success("");
    }

    @Override
    public List<OrderRakutenListRes> getList(Map<String, String> map) {
        QueryWrapper<OrderRakutenDo> wrapper = queryBuild(map);
        List<OrderRakutenDo> list = this.list(wrapper);
        List<OrderRakutenListRes> result = handlerListAfter(list);
        return result;
    }

    @Override
    public PageResult getListPage(Map<String, String> map) {
        QueryWrapper<OrderRakutenDo> wrapper = queryBuild(map);
        IPage<OrderRakutenDo> page = pageInit(map);
        page = this.page(page, wrapper);
        List<OrderRakutenListRes> resList = handlerListAfter(page.getRecords());
        PageResult result = new PageResult(resList, (int) page.getCurrent(), (int) page.getSize(), (int) page.getTotal(), (int) page.getPages());
        return result;
    }

    @Override
    public int orderSync(String dateStart, String dateEnd, String dateType, long shopId) {
        if (StringUtils.isBlank(dateStart)) {
            throw new BizException(SysConstant.Pls_Choose_SyncBeginTime);
        }
        if (StringUtils.isBlank(dateEnd)) {
            throw new BizException(SysConstant.Pls_Choose_SyncEndTime);
        }
        if (StringUtils.isBlank(dateType)) {
            throw new BizException(SysConstant.Pls_Choose_SyncTimeType);
        }
        ShopDo shop = verifyShopTokenExist(shopId);
        String[] orderIds = getRakutenOrderIds(dateStart + "T00:00:00+0900", dateEnd + "T23:59:59+0900", dateType, orderProgressComm,
                shop.getRakutenSecret(), shop.getRakutenLicense());
        getOrder(orderIds, shop);
        return 0;
    }

    private String[] getRakutenOrderIds(String dateStart, String dateEnd, String dateType, int[] orderProgressList, String secret, String license) {
        String authorization = "ESA " + Base64.getEncoder().encodeToString((secret + ":" + license).getBytes());
        String url = GlobalConstants.RakutenURL + "/order/searchOrder/";
        List<String> data = new ArrayList<>();
//        String url = "http://kintocloud.cn:8080/queryAllShopList";
        for (int i = 1; i < 100; i++) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("startDatetime", dateStart);
            jsonObject.put("endDatetime", dateEnd);
            jsonObject.put("dateType", dateType);//1,订单创建时间 3订单支付时间
            jsonObject.put("orderProgressList", orderProgressList);
            JSONObject jsonObject1 = new JSONObject();
            jsonObject1.put("requestRecordsAmount", 1000);
            jsonObject1.put("requestPage", i);
            jsonObject.put("PaginationRequestModel", jsonObject1);
            JSONObject jsonObject2 = new JSONObject();
            jsonObject2.put("userid", 1);
            logger.debug(jsonObject.toJSONString());
            String jsonData = OkHttpUtils.okHttpRequestPost(url, HttpMethod.POST.name(), jsonObject.toJSONString(), authorization);
            JSONObject object = JSONObject.parseObject(jsonData);
//        logger.debug(object.toJSONString());
            if (object.getJSONArray("orderNumberList") == null) {
                if (object.getJSONObject("Results") != null) {
                    String code = object.getJSONObject("Results").getString("errorCode");
                    if (code != null) {
                        if (code.equals("ES01-01")) {
                            updateRakutenLicenseKeyStatus(secret);
                            throw new BizException(SysConstant.Error_SecretKey_Expired);
                        } else if (code.equals("ES04-01")) {
                            updateRakutenLicenseKeyStatus(secret);
                            throw new BizException(SysConstant.Error_SecretKey);
                        }
                    }
                }
                logger.info(jsonObject.toJSONString());
                logger.info(secret + ":" + license);
                return new String[]{};
            } else {
                data.addAll(object.getJSONArray("orderNumberList").toJavaList(String.class));
                if (object.getJSONArray("orderNumberList").size() < 1000) {
                    break;
                }
            }
        }
        String[] strings = data.toArray(new String[]{});
        return strings;
    }

    private void updateRakutenLicenseKeyStatus(String secret) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("rakuten_secret", secret);
        List<ShopDo> list = shopDao.selectList(wrapper);
        for (ShopDo shopDo : list) {
            shopDo.setKeyStatus(0);
            shopDao.updateById(shopDo);
        }
    }


    public String[] searchOrderUnConfirm(String startDate, String endDate, String dateType, String secret, String license) {
        return getRakutenOrderIds(startDate, endDate, dateType,
                orderProgressUnConfirm, secret, license);
    }

    public void getOrder(String[] orderIds, ShopDo shop) {
        String authorization = "ESA " + Base64.getEncoder().encodeToString((shop.getRakutenSecret() + ":" + shop.getRakutenLicense()).getBytes());
        if (orderIds.length < 1) return;
        String url = GlobalConstants.RakutenURL + "/order/getOrder/";
        String cloudkintoUrl = GlobalConstants.CloudkintoURL + "/rakuten/order/getOrder";
        cloudkintoUrl = cloudkintoUrl + "?shopId=" + shop.getId();
        for (int i = 0; i <= orderIds.length / 100; i++) {
            String[] orderLimit;
            if (i == orderIds.length / 100) {
                orderLimit = Arrays.copyOfRange(orderIds, i * 100, orderIds.length);
            } else {
                orderLimit = Arrays.asList(orderIds).subList(i * 100, (i + 1) * 100).toArray(new String[100]);
            }
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("orderNumberList", orderLimit);
            jsonObject.put("version", 7);
            logger.debug(jsonObject.toJSONString());
            String jsonData = OkHttpUtils.okHttpRequestPost(url, HttpMethod.POST.name(), jsonObject.toJSONString(), authorization);
//            String jsonData1 = OkHttpUtils.okHttpRequest(cloudkintoUrl, HttpMethod.POST.name(), jsonData, authorization);
            getOrderFromJp(false, String.valueOf(shop.getId()), jsonData);
            logger.debug(jsonObject.toJSONString());
        }
    }


    public void getOrderNew(String[] orderIds, ShopDo shop) {
        String authorization = "ESA " + Base64.getEncoder().encodeToString((shop.getRakutenSecret() + ":" + shop.getRakutenLicense()).getBytes());
        if (orderIds.length < 1) return;
        String url = GlobalConstants.RakutenURL + "/order/getOrder/";
        String cloudkintoUrl = GlobalConstants.CloudkintoURL + "/rakuten/order/getOrder";
        cloudkintoUrl = cloudkintoUrl + "?shopId=" + shop.getId();
        for (int i = 0; i <= orderIds.length / 100; i++) {
            String[] orderLimit;
            if (i == orderIds.length / 100) {
                orderLimit = Arrays.copyOfRange(orderIds, i * 100, orderIds.length);
            } else {
                orderLimit = Arrays.asList(orderIds).subList(i * 100, (i + 1) * 100).toArray(new String[100]);
            }
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("orderNumberList", orderLimit);
            jsonObject.put("version", 7);
            logger.debug(jsonObject.toJSONString());
            String jsonData = OkHttpUtils.okHttpRequestPost(url, HttpMethod.POST.name(), jsonObject.toJSONString(), authorization);
//            String jsonData1 = OkHttpUtils.okHttpRequest(cloudkintoUrl, HttpMethod.POST.name(), jsonData, authorization);
            getOrderFromJp(true, String.valueOf(shop.getId()), jsonData);
            logger.debug(jsonObject.toJSONString());
        }
    }


    @Override
    public Object getOrderFromJp(boolean isNew, String shopId, String jsonData) {
        if (StringUtils.isBlank(shopId)) shopId = "28";
        ShopDo shop = shopDao.selectById(shopId);
        JSONObject object = JSONObject.parseObject(jsonData);
        if (object == null) return null;
        if (object.getJSONArray("OrderModelList") == null) return null;
        List<RakutenOrderModel> orderModels = JSONObject.parseArray(object.getJSONArray("OrderModelList").toJSONString(), RakutenOrderModel.class);
        List<String> confirmOrderIds = new ArrayList<>();
        List<String> queryOrderIds = new ArrayList<>();
        List<String> cancelOrderIds = new ArrayList<>();
        Map<String, RakutenOrderModel> confirmOrders = new HashMap<>();
        for (RakutenOrderModel orderModel :
                orderModels) {
            if (orderModel.getOrderProgress() == 100) {
                if (orderModel.getIsolatedIslandFlag() == 1 && !shop.getAutoConfirmOrderIslandFlag()) {//1是离岛 0是正常
                    continue;
                }
                kk:
                for (RakutenOrderModel.PackageModelListEntity packageModelListEntity :
                        orderModel.getPackageModelList()) {
                    if ((packageModelListEntity.getSenderModel().getPrefecture().contains("北海道")
                            || packageModelListEntity.getSenderModel().getPrefecture().contains("沖縄")
                            || inBlackList(orderModel.getOrdererModel()))
                            && !shop.getAutoConfirmOrderIslandFlag()) {
                        continue kk;
                    }
//                        } else {
//                        boolean b = true;
                    for (RakutenOrderModel.PackageModelListEntity.ItemModelListEntity itemModelListEntity :
                            packageModelListEntity.getItemModelList()) {
                        String itemNumber = itemModelListEntity.getItemNumber();
                        if (StringUtils.isNotBlank(itemNumber))
                            if (itemNumber.contains("fukubukuro") || itemModelListEntity.getManageNumber().contains("fukubukuro")
                                    || itemNumber.contains("TX00311CAA")
                                    || itemNumber.contains("TX00314BAA")
                                    || itemNumber.contains("TX00314CAA")
                                    || itemNumber.contains("TX00311BAA")) {
                                continue kk;
                            }
                    }
//                        if (b) {
                    confirmOrderIds.add(orderModel.getOrderNumber());
                    confirmOrders.put(orderModel.getOrderNumber(), orderModel);
//                        }
                }
            } else {
                long orderId = saveRakutenOrder(isNew, orderModel, shop.getId(), shop.getCompanyId());
                if (orderModel.getOrderProgress() == 300 && orderId != 0)
                    queryOrderIds.add(String.valueOf(orderId));
                if (orderModel.getOrderProgress() == 900 && orderId != 0)
                    cancelOrderIds.add(String.valueOf(orderId));
            }
        }
        if (shop.getAutoConfirmOrderFlag()) {
            Map map = new HashMap();
            confirmRakutenOrder(confirmOrderIds, shop.getRakutenSecret(), shop.getRakutenLicense(), confirmOrders, shop.getId());
        }
        //todo  自动导出到发货单
        if (shop.getAutoSendOutFlag()) {
            if (shop.getCompanyId().intValue() == 1) {
                String time = TimeUtils.formatTime(new Date());
                String hours = time.split(":")[0];
                if (hours.equals("08") || hours.equals("12")) {

                }
            }
            logger.info("Rakuten自动发货开始");
            queryOrder2SendOut(queryOrderIds.toArray(new String[queryOrderIds.size()]), 1l, true);
            if (cancelOrderIds.size() > 0)
                outputService.cancelOrderByRakutenOrderId(cancelOrderIds);
            logger.info("Rakuten自动发货结束");
        }
        return null;
    }

    private boolean inBlackList(RakutenOrderModel.OrdererModelEntity orderModel) {
        if (orderModel.getFamilyName().equals("松江") && orderModel.getFirstName().equals("千奈未")
                && orderModel.getEmailAddress().equals("8c1f48f4515a862f1f24b0b64526c6d0s1@ym.fw.rakuten.ne.jp"))
            return true;
        return false;
    }

    private long saveRakutenOrder(boolean isNew, RakutenOrderModel orderModel, Long id, Long companyId) {
        OrderRakutenDo rakutenDo = new OrderRakutenDo();
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("order_number", orderModel.getOrderNumber());
        wrapper.last("limit 1");
        OrderRakutenDo orderRakutenDo = baseMapper.selectOne(wrapper);
        if (orderRakutenDo != null) {
            rakutenDo = orderRakutenDo;
            if (isNew && orderRakutenDo.getOrderProgress() != 200)
                return 0;
        } else {
            rakutenDo.setCompanyId(companyId);
            rakutenDo.setShopId(id);
        }
        BeanUtils.copyProperties(orderModel, rakutenDo);
        rakutenDo.setOrderProgress(orderModel.getOrderProgress());
        //日期时间格式
        if (!rakutenDo.getCompanyId().equals(355) && (rakutenDo.getOrderProgress().intValue() == 500 || rakutenDo.getOrderProgress().intValue() == 900)) {
            rakutenDo.setIsSendOut(1);
        }
        rakutenDo.setOrderDatetime(replaceStrDateFromat(orderModel.getOrderDatetime()));
        rakutenDo.setOrderFixDatetime(replaceStrDateFromat(orderModel.getOrderFixDatetime()));
        rakutenDo.setShopOrderCfmDatetime(replaceStrDateFromat(orderModel.getShopOrderCfmDatetime()));
        rakutenDo.setShippingInstDatetime(replaceStrDateFromat(orderModel.getShippingInstDatetime()));
        rakutenDo.setShippingCmplRptDatetime(replaceStrDateFromat(orderModel.getShippingCmplRptDatetime()));
        rakutenDo.setRequestPrice((orderModel.getRequestPrice().floatValue()));
        if (StringUtils.isBlank((orderModel.getDeliveryDate())))
            rakutenDo.setDeliveryDate("");
        if (!org.springframework.util.StringUtils.isEmpty(orderModel.getShippingTerm())) {
            if (orderModel.getShippingTerm().length() > 3) {
                rakutenDo.setShippingTerm(orderModel.getShippingTerm().substring(0, 2) + "-" + orderModel.getShippingTerm().substring(2));
            } else if (orderModel.getShippingTerm().length() > 1) {
                rakutenDo.setShippingTerm(orderModel.getShippingTerm().substring(0, 1) + "-" + orderModel.getShippingTerm().substring(1));
            }
        } else {
            rakutenDo.setShippingTerm("");
        }
        if (StringUtils.isNotBlank(orderModel.getRemarks())) {
            String tips = orderModel.getRemarks().replaceAll("\\[配送日時指定:\\]", "").replaceAll("\\n", "");
            if (tips.length() > 500)
                tips = tips.substring(0, 497) + "...";
            rakutenDo.setRemarks(tips);
        }
        if (StringUtils.isBlank(rakutenDo.getSystemMemo()))
            rakutenDo.setSystemMemo(orderModel.getMemo());
        //订购人信息
        rakutenDo.setOrderCity(orderModel.getOrdererModel().getCity());
        rakutenDo.setOrderSubAddres(orderModel.getOrdererModel().getSubAddress());
        rakutenDo.setOrderEmailAddress(orderModel.getOrdererModel().getEmailAddress());
        rakutenDo.setOrderPhoneNumber(orderModel.getOrdererModel().getPhoneNumber1() + "-" + orderModel.getOrdererModel().getPhoneNumber2() + "-" + orderModel.getOrdererModel().getPhoneNumber3());
        rakutenDo.setOrderPostCode(orderModel.getOrdererModel().getZipCode1() + "-" + orderModel.getOrdererModel().getZipCode2());
        rakutenDo.setOrderPrefecture(orderModel.getOrdererModel().getPrefecture());
        rakutenDo.setOrderName(orderModel.getOrdererModel().getFamilyName() + " " + orderModel.getOrdererModel().getFirstName());
        rakutenDo.setOrderFamilyNameKana(orderModel.getOrdererModel().getFamilyNameKana());
        rakutenDo.setOrderFirstNameKana(orderModel.getOrdererModel().getFirstNameKana());
        rakutenDo.setOrderBirthday(orderModel.getOrdererModel().getBirthYear() + "-" + orderModel.getOrdererModel().getBirthMonth() + "-" + orderModel.getOrdererModel().getBirthDay());
        rakutenDo.setOrderSex(rakutenDo.getOrderSex());
        //
        if (orderModel.getPointModel() != null)
            rakutenDo.setUsedPoint(orderModel.getPointModel().getUsedPoint());
        if (orderModel.getDeliveryModel() != null)
            rakutenDo.setDeliveryName(orderModel.getDeliveryModel().getDeliveryName());
        if (orderModel.getCouponModelList() != null && orderModel.getCouponModelList().size() > 0) {
            rakutenDo.setUsedCouponTotalPrice(orderModel.getCouponModelList().get(0).couponTotalPrice);
        }
        if (rakutenDo.getId() == null) {
            save(rakutenDo);
        } else {
            if (rakutenDo.getOrderProgress().intValue() == 500 || rakutenDo.getOrderProgress().intValue() == 900) {
                rakutenDo.setIsSendOut(1);
            } else {
                rakutenDo.setIsSendOut(null);
            }
            rakutenDo.setIsUploadExpress(null);
            rakutenDo.setIsSendMail(null);
            updateById(rakutenDo);
        }
        for (RakutenOrderModel.PackageModelListEntity packageModelListEntity :
                orderModel.getPackageModelList()) {
            OrderRakutenPackageDo rakutenPackageInfo = new OrderRakutenPackageDo();
            BeanUtils.copyProperties(packageModelListEntity, rakutenPackageInfo);
            List<OrderRakutenProductDo> rakutenProductInfos = new ArrayList<>();
            StringBuilder sb = new StringBuilder();
            for (RakutenOrderModel.PackageModelListEntity.ItemModelListEntity itemModelListEntity :
                    packageModelListEntity.getItemModelList()) {
                OrderRakutenProductDo productInfo = new OrderRakutenProductDo();
                BeanUtils.copyProperties(itemModelListEntity, productInfo);
                productInfo.setPrice(itemModelListEntity.getPrice());
                if (itemModelListEntity.getSkuModelList() != null && itemModelListEntity.getSkuModelList().size() > 0) {
                    String merchantDefinedSkuId = itemModelListEntity.getSkuModelList().get(0).getMerchantDefinedSkuId();
                    if (StringUtils.isNotEmpty(merchantDefinedSkuId)) {
                        itemModelListEntity.setItemNumber(itemModelListEntity.getSkuModelList().get(0).getMerchantDefinedSkuId());
                    } else if (StringUtils.isBlank(itemModelListEntity.getItemNumber())) {
                        itemModelListEntity.setItemNumber(itemModelListEntity.getSkuModelList().get(0).getVariantId());
                    }
                    itemModelListEntity.setSelectedChoice(itemModelListEntity.getSkuModelList().get(0).getSkuInfo() + "\n" + itemModelListEntity.getSelectedChoice());
                }
                if (companyId == 1 || companyId == 44 || companyId.intValue() == 201) {
                    productInfo.setItemNumber(replaceRakutenItemManageNuber(itemModelListEntity.getItemNumber(), itemModelListEntity.getManageNumber()));
                } else {
                    productInfo.setItemNumber(itemModelListEntity.getItemNumber());
                }
                if (StringUtils.isBlank(itemModelListEntity.getItemNumber())) {
                    productInfo.setItemNumber(itemModelListEntity.getManageNumber());
                }
//                long productId = 0;
//                try {
//                    productId = getProductId(productInfo.getItemNumber(), rakutenDo.getCompanyId());
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//                productInfo.setProductInfoId(productId);
                if (itemModelListEntity.getDelvdateInfo() != null) {
                    if (itemModelListEntity.getDelvdateInfo().contains("予約販売")) {
                        rakutenDo.setOrderType(6);
                        if (rakutenDo.getSystemMemo() == null) {
                            rakutenDo.setSystemMemo(itemModelListEntity.getDelvdateInfo());
                        } else if (!rakutenDo.getSystemMemo().contains("予約販売")) {
                            rakutenDo.setSystemMemo(("予約販売 " + rakutenDo.getSystemMemo()));
                        }
                    } else if (itemModelListEntity.getDelvdateInfo().contains("あす楽")) {
                        rakutenDo.setAsurakuFlag(1);
                        if (rakutenDo.getSystemMemo() == null) {
                            rakutenDo.setSystemMemo("あす楽");
                        } else if (!rakutenDo.getSystemMemo().contains("あす楽")) {
                            rakutenDo.setSystemMemo(("あす楽 " + rakutenDo.getSystemMemo()));
                        }
                    }
                }
                productInfo.setBasketId(packageModelListEntity.getBasketId());
                rakutenProductInfos.add(productInfo);
                if (sb.length() > 0) sb.append(",");
                sb.append(productInfo.getItemNumber() + "*" + productInfo.getUnits());
            }
            rakutenDo.setCommoditySku(sb.toString());
            rakutenDo.setIsSendOut(null);
            rakutenDo.setIsUploadExpress(null);
            rakutenDo.setIsSendMail(null);
            updateById(rakutenDo);
            rakutenProductService.saveOrUpdateProductList(rakutenProductInfos, packageModelListEntity.getBasketId());
            rakutenPackageInfo.setOrderId(rakutenDo.getId());
            //收货人信息
            rakutenPackageInfo.setOrderCity(packageModelListEntity.getSenderModel().getCity());
            rakutenPackageInfo.setOrderSubAddres(packageModelListEntity.getSenderModel().getSubAddress());
//            rakutenPackageInfo.set(packageModelListEntity.getSenderModel().getEmailAddress());
            rakutenPackageInfo.setOrderPhoneNumber(packageModelListEntity.getSenderModel().getPhoneNumber1() + "-" + packageModelListEntity.getSenderModel().getPhoneNumber2() + "-" + packageModelListEntity.getSenderModel().getPhoneNumber3());
            rakutenPackageInfo.setOrderPostCode(packageModelListEntity.getSenderModel().getZipCode1() + "-" + packageModelListEntity.getSenderModel().getZipCode2());
            rakutenPackageInfo.setOrderPrefecture(packageModelListEntity.getSenderModel().getPrefecture());
            rakutenPackageInfo.setOrderName(packageModelListEntity.getSenderModel().getFamilyName() + " " + packageModelListEntity.getSenderModel().getFirstName());
            rakutenPackageInfo.setOrderFamilyNameKana(packageModelListEntity.getSenderModel().getFamilyNameKana());
            rakutenPackageInfo.setOrderFirstNameKana(packageModelListEntity.getSenderModel().getFirstNameKana());
            for (ShippingModelEntity shippingModelEntity : packageModelListEntity.getShippingModelList()) {

                OrderRakutenShippingDo shippingDo = new OrderRakutenShippingDo();
                shippingDo.setPackageId(packageModelListEntity.getBasketId());
                shippingDo.setDeliveryCompany(shippingModelEntity.getDeliveryCompany());
                shippingDo.setDeliveryCompanyName(shippingModelEntity.getDeliveryCompanyName());
                shippingDo.setShippingDate(shippingModelEntity.getShippingDate());
                shippingDo.setShippingDetailId(shippingModelEntity.getShippingDetailId());
                shippingDo.setShippingNumber(shippingModelEntity.getShippingNumber());
                if (rakutenShippingDao.selectById(shippingModelEntity.getShippingDetailId()) == null) {
                    rakutenShippingDao.insert(shippingDo);
                } else {
                    rakutenShippingDao.updateById(shippingDo);
                }
            }
            rakutenPackageService.saveOrUpdatePackage(rakutenPackageInfo);
        }

        if (orderModel.getCouponModelList() != null && orderModel.getCouponModelList().size() > 0) {
            rakutenDo.setUsedCouponTotalPrice(orderModel.getCouponModelList().get(0).couponTotalPrice);
            for (RakutenOrderModel.CouponModel couponModel : orderModel.getCouponModelList()) {
                OrderRakutenCouponDo couponDo = new OrderRakutenCouponDo();
                List<OrderRakutenCouponDo> orderRakutenCouponDos = rakutenCouponDao.selectList(new LambdaQueryWrapper<OrderRakutenCouponDo>()
                        .eq(OrderRakutenCouponDo::getItemId, couponModel.getItemId())
                        .eq(OrderRakutenCouponDo::getOrderId, rakutenDo.getId()));
                BeanUtils.copyProperties(couponModel, couponDo);
                couponDo.setOrderId(rakutenDo.getId());
                if (orderRakutenCouponDos == null | orderRakutenCouponDos.size() < 1) {
                    rakutenCouponDao.insert(couponDo);
                } else {
                    couponDo.setId(orderRakutenCouponDos.get(0).getId());
                    rakutenCouponDao.updateById(couponDo);
                }
            }
        }
        return rakutenDo.getId();
    }

    private String replaceStrDateFromat(String orderDatetime) {
        if (StringUtils.isEmpty(orderDatetime)) return "";
        return orderDatetime.replace("T", " ").replace("+0900", "");
    }

    private String replaceRakutenItemManageNuber(String itemNumber, String manageNumber) {
        if (StringUtils.isBlank(itemNumber)) return itemNumber;
        if (itemNumber.length() < 11) return itemNumber;
        itemNumber = itemNumber.replaceFirst("(?i)" + manageNumber, "");
        StringBuilder stringBuilder = new StringBuilder(itemNumber);
        if (stringBuilder.length() > 11 && !stringBuilder.toString().contains("+")) {
            if (itemNumber.contains("PP")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("PP"));
            } else if (itemNumber.contains("TX")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("TX"));
            } else if (itemNumber.contains("XL")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("XL"));
            } else if (itemNumber.contains("TT")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("TT"));
            } else if (itemNumber.contains("PJ")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("PJ"));
            } else if (itemNumber.contains("XJ")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("XJ"));
            } else if (itemNumber.contains("SF")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("SF"));
            } else if (itemNumber.contains("WF")) {
                itemNumber = stringBuilder.substring(stringBuilder.indexOf("WF"));
            }
        }
        return itemNumber;
    }

    @Override
    public void sendInvitationEmail1(long shopId, String updateTime, String s1) {
        LambdaQueryWrapper<OrderOutputDo> orderOutputQueryWrapper = new LambdaQueryWrapper<>();
        orderOutputQueryWrapper.eq(OrderOutputDo::getShopId, shopId);
        orderOutputQueryWrapper.eq(OrderOutputDo::getStatus, DicBusinessItemConstant.outSendOut);
        orderOutputQueryWrapper.gt(OrderOutputDo::getUpdateTime, updateTime);
        orderOutputQueryWrapper.and(orderOutputDoLambdaQueryWrapper -> {
            orderOutputDoLambdaQueryWrapper.eq(OrderOutputDo::getStorageId, 10)
                    .or().eq(OrderOutputDo::getStorageId, 11);
        });
        List<OrderOutputDo> orderOutputDoList = outputService.list(orderOutputQueryWrapper);
        if (orderOutputDoList == null || orderOutputDoList.size() < 1) return;
        List<String> orderNumbers = orderOutputDoList.stream().map(OrderOutputDo::getOrderNo).collect(Collectors.toList());
        if (orderNumbers.size() < 1) return;
        LambdaQueryWrapper<OrderRakutenDo> rakutenDoLambdaQueryWrapper = new LambdaQueryWrapper<>();
        rakutenDoLambdaQueryWrapper.in(OrderRakutenDo::getOrderNumber, orderNumbers);
        List<OrderRakutenDo> orderRakutenDoList = dao.selectList(rakutenDoLambdaQueryWrapper);
        if (orderRakutenDoList.size() < 1) return;
        sendMail(orderRakutenDoList, shopId, 5);
    }

    @Override
    public void sendRakutenMail11Test(long shopId, long orderId) {
        Session session = mailService.initMailSession();
        Transport transport = mailService.initMailTransport(session);
//        Session session = mailService.initRakutenMailSession();
//        Transport transport = null;
//        if (shopId == 4) {
//            transport = mailService.initRakutenMailTransport(session);
//        } else if (shopId == 28) {
//            transport = mailService.initRakutenMailTransport(session, "382120", "1kNt34Tydu");
//        } else if (shopId == 395) {
//            transport = mailService.initRakutenMailTransport(session, "408139", "sOSLaMxeqf");
//        } else if (shopId == 338) {
//            transport = mailService.initRakutenMailTransport(session, "408139", "sOSLaMxeqf");
//        }
        OrderRakutenDo rakutenDo = dao.selectById(orderId);
        QueryWrapper packageWrapper = new QueryWrapper();
        packageWrapper.eq("order_id", orderId);
        List<OrderRakutenPackageDo> orderRakutenPackageDoList = packageDao.selectList(packageWrapper);
        OrderRakutenShippingDo orderRakutenShippingDo = rakutenShippingDao.selectById(670384044);
        List<ShippingModelEntity> shippingModelEntitys = new ArrayList<>();
        ShippingModelEntity shippingModelEntity = new ShippingModelEntity(orderRakutenShippingDo.getShippingDetailId(), orderRakutenShippingDo.getDeliveryCompany(),
                orderRakutenShippingDo.getShippingNumber(), orderRakutenShippingDo.getShippingDate());
        shippingModelEntitys.add(shippingModelEntity);
        for (int i = 0; i < orderRakutenPackageDoList.size(); i++) {
            OrderRakutenPackageDo orderRakutenPackageDo = orderRakutenPackageDoList.get(i);
            QueryWrapper productWrapper = new QueryWrapper();
            productWrapper.eq("basket_id", orderRakutenPackageDo.getBasketId());
            List<OrderRakutenProductDo> orderRakutenProductList = productDao.selectList(productWrapper);
            mailService.sendEmailRakuten(session, transport, String.format("【%s】注文内容ご確認！", "Chende"),
                    getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                    "chende@dws789.com", "ding@cloudkinto.com"
//                    "ding@sanchoum.com", "ding@cloudkinto.com"
                    , "text/html;charset=Shift-JIS");


            mailService.sendEmailRakuten(session, transport, String.format("【%s】商品発送のご案内について", "Chende"),
                    getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shippingModelEntitys, shopId),
                    "chende@dws789.com", "ding@cloudkinto.com"
//                    "ding@sanchoum.com", "ding@cloudkinto.com"
                    , "text/html;charset=Shift-JIS");
        }

//        Session session = mailService.initMailSession();
//        Transport transport = mailService.initMailTransport(session);
//        OrderRakutenDo rakutenDo = dao.selectById(orderId);
//        QueryWrapper packageWrapper = new QueryWrapper();
//        packageWrapper.eq("order_id", orderId);
//        List<OrderRakutenPackageDo>  = packageDao.selectList(packageWrapper);
//        OrderRakutenShippingDo orderRakutenShippingDo = rakutenShippingDao.selectById(1597771356);
//        ShippingModelEntity shippingModelEntity = new ShippingModelEntity(orderRakutenShippingDo.getShippingDetailId(), orderRakutenShippingDo.getDeliveryCompany(),
//                orderRakutenShippingDo.getShippingNumber(), orderRakutenShippingDo.getShippingDate());
//        for (int i = 0; i < orderRakutenPackageDoList.size(); i++) {
//            OrderRakutenPackageDo orderRakutenPackageDo = orderRakuorderRakutenPackageDoListtenPackageDoList.get(i);
//            QueryWrapper productWrapper = new QueryWrapper();
//            productWrapper.eq("basket_id", orderRakutenPackageDo.getBasketId());
//            List<OrderRakutenProductDo> orderRakutenProductList = productDao.selectList(productWrapper);
//            mailService.sendEmail(session, transport, "【测试邮件！！！】【楽天 Greatstar Official】ご注文ありがとうございます！",
//                    getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shippingModelEntity, shopId),
//                    "770403372@qq.com");
//        }
    }

    @Override
    public void sendInvitationEmail(Long shopId, String startDate, String endDate, String keyword, int current, int pageSize, int delay) {
        LambdaQueryWrapper<OrderRakutenDo> rakutenDoLambdaQueryWrapper = new LambdaQueryWrapper<>();
        rakutenDoLambdaQueryWrapper.eq(OrderRakutenDo::getShopId, shopId);
        if (StringUtils.isNotBlank(keyword)) {
            rakutenDoLambdaQueryWrapper.like(OrderRakutenDo::getCommoditySku, keyword);
        }
        rakutenDoLambdaQueryWrapper.gt(OrderRakutenDo::getOrderDatetime, startDate)
                .lt(OrderRakutenDo::getOrderDatetime, endDate);
        IPage<OrderRakutenDo> page = new Page();
        page.setSize(pageSize);
        page.setCurrent(current);
        IPage<OrderRakutenDo> rakutenDoIPage = this.page(page, rakutenDoLambdaQueryWrapper);
        if (rakutenDoIPage == null) return;
        List<OrderRakutenDo> rakutenDoList = rakutenDoIPage.getRecords();
        if (rakutenDoList == null || rakutenDoList.size() < 1) return;
        sendMail(rakutenDoList, shopId, delay);
    }

    private void sendMail(List<OrderRakutenDo> rakutenDoList, Long shopId, int delay) {
        Session session = mailService.initRakutenMailSession();
        Transport transport = null;
        if (shopId == 4) {
            transport = mailService.initRakutenMailTransport(session);
        } else if (shopId == 28) {
            transport = mailService.initRakutenMailTransport(session, "382120", "1kNt34Tydu");
        } else if (shopId.intValue() == 106) {
            transport = mailService.initRakutenMailTransport(session, "382110", "l1baRYIl7t");
        } else if (shopId.intValue() == 304) {
            transport = mailService.initRakutenMailTransport(session, "398853", "BOLVP3nik3");
        } else {
            transport = mailService.initRakutenMailTransport(session, "377156", "D7TXygKGZ6");
        }
        for (OrderRakutenDo rakutenDo : rakutenDoList) {
            if (rakutenDo == null || rakutenDo.getOrderEmailAddress() == null) continue;
            //过滤重复邮件
            if (Arrays.asList(strings).contains(rakutenDo.getOrderEmailAddress())) {
//                if (sendMailStr.contains(rakutenDo.getOrderEmailAddress())) {
//                if (redisTemplate.opsForSet().isMember(rakutenDo.getOrderEmailAddress(),rakutenDo.getOrderEmailAddress())) {
//                    continue;
//                } else {
//                    redisTemplate.opsForSet().add(rakutenDo.getOrderEmailAddress());
////                    sendMailStr.add(rakutenDo.getOrderEmailAddress());
//                }
                if (redisTemplate.opsForSet().isMember(RakutenInvitationSetKey, rakutenDo.getOrderEmailAddress())) {
                    continue;
                } else {
                    redisTemplate.opsForSet().add(RakutenInvitationSetKey, rakutenDo.getOrderEmailAddress());
//                    sendMailStr.add(rakutenDo.getOrderEmailAddress());
                }
            }
            switch (shopId.intValue()) {
                case 4:
//                    mailService.sendEmailRakuten(session, transport, "楽天スーパーSALE 半額商品お知らせ",
//                            getInvitationTemplate(shopId),
//                            rakutenDo.getOrderEmailAddress()
//                            , "rakuten_service@sanchoum.com","text/html;charset=Shift-JIS");
                    mailService.sendEmailRakuten(session, transport, "MWPOスーパーSALE お得なキャンペーンいっぱい！最大50％OFF",
                            getInvitationTemplate(shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "rakuten_service@sanchoum.com", "text/html;charset=Shift-JIS");
//
                    break;
                case 28:
                    mailService.sendEmailRakuten(session, transport, "楽天スーパーSALE 半額商品お知らせ",
                            getInvitationTemplate(shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "futatabi@sanchoum.com", "text/html;charset=Shift-JIS");
                    break;
                case 44:
                    mailService.sendEmailRakuten(session, transport, "楽天スーパーSALE 半額商品お知らせ",
                            getInvitationTemplate(shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "kuma@onetigris.com", "text/html;charset=Shift-JIS");
                    break;
                case 63:
                case 106:
                    mailService.sendEmailRakuten(session, transport, "ヤスヨシ4弾特価連発ビッグセール一覧",
                            getInvitationTemplate(106L),
                            rakutenDo.getOrderEmailAddress()
                            , "yasuyoshi@sanchoum.com", "text/html;charset=Shift-JIS");
                    break;
                case 304:
                    mailService.sendEmailRakuten(session, transport, "楽天スーパーSALE 半額商品お知らせ",
                            getInvitationTemplate(shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "titilife@hakyuuoku.com", "text/html;charset=Shift-JIS");
                    break;
                default:
                    mailService.sendEmail(session, transport, String.format("【" + shopId + "】未找到对应店铺", shopDao.selectById(shopId).getShopName()),
                            getInvitationTemplate(shopId),
                            "770403372@qq.com");
                    break;
            }
            try {
                Thread.sleep(delay * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

//            logger.debug(getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId));

        mailService.transportClose(transport);

    }


    private void confirmRakutenOrder(List<String> confirmOrderIds, String rakutenSecret, String rakutenLicense, Map<String, RakutenOrderModel> confirmOrders, Long shopId) {
        if (confirmOrderIds.size() < 1) return;
        String authorization = "ESA " + Base64.getEncoder().encodeToString((rakutenSecret + ":" + rakutenLicense).getBytes());
        String url = GlobalConstants.RakutenURL + "/order/confirmOrder/";
//        String url = "http://kintocloud.cn:8080/queryAllShopList";
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("orderNumberList", confirmOrderIds);
        logger.debug(jsonObject.toJSONString());
        String jsonData = OkHttpUtils.okHttpRequestPost(url, HttpMethod.POST.name(), jsonObject.toJSONString(), authorization);
        List<ComfirmRakutenResponse> responseList = JSONObject.parseObject(jsonData).getJSONArray("MessageModelList").toJavaList(ComfirmRakutenResponse.class);
        //todo 配信   freemaker
        Session session = mailService.initRakutenMailSession();
        Transport transport = null;
        if (shopId == 4) {
            transport = mailService.initRakutenMailTransport(session);
        } else if (shopId == 28) {
            transport = mailService.initRakutenMailTransport(session, "382120", "1kNt34Tydu");
        } else if (shopId == 20) {
            transport = mailService.initRakutenMailTransport(session, "405296", "BTO8mJ8Xnc");
        } else if (shopId.intValue() == 106) {
            transport = mailService.initRakutenMailTransport(session, "382110", "l1baRYIl7t");
        } else if (shopId.intValue() == 304) {
            transport = mailService.initRakutenMailTransport(session, "398853", "BOLVP3nik3");
        } else if (shopId.intValue() == 395) {
            transport = mailService.initRakutenMailTransport(session, "408139", "sOSLaMxeqf");
        } else if (shopId.intValue() == 338) {
            transport = mailService.initRakutenMailTransport(session, "381806", "8PR6YFmoUv");
        } else if (shopId.intValue() == 456) {
            transport = mailService.initRakutenMailTransport(session, "411637", "0BC2qpttzF");
        } else if (shopId.intValue() == 363) {
            transport = mailService.initRakutenMailTransport(session, "416163", "aH7I1qDxiZ");
        } else if (shopId.intValue() == 292) {
            transport = mailService.initRakutenMailTransport(session, "420012", "V9M8DhggHx");
        } else if (shopId.intValue() == 518) {
            transport = mailService.initRakutenMailTransport(session, "394190", "OdBkeAyepr");
        } else if (shopId.intValue() == 519) {
            transport = mailService.initRakutenMailTransport(session, "411152", "H8NDza3uV7");
        } else if (shopId.intValue() == 515) {
            transport = mailService.initRakutenMailTransport(session, "370720", "POan1u4rzR");
        } else if (shopId.intValue() == 432) {
            transport = mailService.initRakutenMailTransport(session, "422396", "XSyddkbhPn");
        }  else {
            transport = mailService.initRakutenMailTransport(session, "377156", "D7TXygKGZ6");
        }
        for (ComfirmRakutenResponse response :
                responseList) {
            if (!"ORDER_EXT_API_CONFIRM_ORDER_INFO_101".equals(response.getMessageCode())) continue;
            RakutenOrderModel orderModel = confirmOrders.get(response.getOrderNumber());
            OrderRakutenDo rakutenDo = getRakutenDo(orderModel);
            if (rakutenDo == null) continue;
            OrderRakutenPackageDo orderRakutenPackageDo = getRakutenPackageDO(orderModel);
            List<OrderRakutenProductDo> orderRakutenProductList = getRakutenProductInfoDo(orderModel);
            logger.info("店铺" + shopId.intValue() + "  " + rakutenDo.getOrderNumber() + "自动确认发信");
            switch (shopId.intValue()) {
                case 4:
                    mailService.sendEmailRakuten(session, transport, "【MWPO】注文確定のお知らせ",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "rakuten_service@sanchoum.com", "text/html;charset=Shift-JIS");
//
                    break;
                case 28:
                    mailService.sendEmailRakuten(session, transport, "【FUTATABI】注文確定のお知らせ",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "futatabi@sanchoum.com", "futatabi@sanchoum.com", "text/html;charset=Shift-JIS");
                    break;
                case 44:
                    mailService.sendEmailRakuten(session, transport, "【OneTigris Camping楽天市場店】ご注文ありがとうございます！",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "kuma@onetigris.com", "icey@onetigris.com", "text/html;charset=Shift-JIS");
                    break;
                case 106:
                    mailService.sendEmailRakuten(session, transport, "【イオドウス楽天市場店】注文確定のお知らせ",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "yasuyoshi@sanchoum.com", "text/html;charset=Shift-JIS");
                    break;
                case 304:
                    mailService.sendEmailRakuten(session, transport, "【titilife】注文確定のお知らせ",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "titilife@hakyuuoku.com", "text/html;charset=Shift-JIS");
                    break;
                case 395:
                    mailService.sendEmailRakuten(session, transport, "【楽天 Greatstar Official】ご注文ありがとうございます！",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "rakuten.jp@greatstartools.com", "greatstarofficial@shop.rakuten.co.jp", "text/html;charset=Shift-JIS");
                    break;
                case 338:
                    mailService.sendEmailRakuten(session, transport, "【Maydolly楽天市場店】注文確定のお知らせ",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "maydolly@tongzhou-ec.com", "maydolly@tongzhou-ec.com", "text/html;charset=Shift-JIS");
                    break;
                case 456:
                    mailService.sendEmailRakuten(session, transport, "【楽天 MamimamiHome】注文確定のお知らせ",
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress()
                            , "rakuten_kyo@ywshsdzswyxgs.wecom.work", "text/html;charset=Shift-JIS");
                    break;
                case 363:
                    mailService.sendEmailRakuten(session, transport, String.format("【楽天 %s】ご注文ありがとうございます！", "Fortella"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(), "service@fortellababy.com"
                            , "text/html;charset=Shift-JIS");
                    break;
                case 292:
                    mailService.sendEmailRakuten(session, transport, String.format("【楽天 %s】ご注文ありがとうございます！", "Hardware Factory Store"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(), "shirley@hfsus.com"
                            , "text/html;charset=Shift-JIS");
                    break;
                case 518:
                    mailService.sendEmailRakuten(session, transport, String.format("【%s】ご注文ありがとうございます！", "Kiboer"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(), "kiboer@dws789.com"
                            , "text/html;charset=Shift-JIS");
                    break;
                case 519:
                    mailService.sendEmailRakuten(session, transport, String.format("【%s】ご注文ありがとうございます！", "Kiboerュウカショップ"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(), "support@kiboer.com"
                            , "text/html;charset=Shift-JIS");
                    break;
                case 515:
                    mailService.sendEmailRakuten(session, transport, String.format("【%s】注文内容ご確認！", "Chende"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(), "chende@dws789.com"
                            , "text/html;charset=Shift-JIS");
                    break;
                    case 432:
                    mailService.sendEmailRakuten(session, transport, String.format("【%s】注文内容ご確認！", "Lyncohome"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(), "rakutenop@lyncohome.com"
                            , "text/html;charset=Shift-JIS");
                    break;
                case 20:
                    mailService.sendEmailRakuten(session, transport, String.format("【楽天 %s】ご注文ありがとうございます！", "magichut"),
                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
                            rakutenDo.getOrderEmailAddress(),
                            "sanwamirai@e-mail.jp", "text/html;charset=Shift-JIS");
                    break;
                default:
//                    mailService.sendEmail(String.format("【" + shopId + "】未找到对应店铺", shopDao.selectById(shopId).getShopName()),
//                            getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId),
//                            "770403372@qq.com");
                    break;
            }
//            logger.debug(getConfirmEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList, shopId));
            operateRecordDao.operateAddRecord(SysConstant.OPERATE_SEND_MAIL_CONFIRM, rakutenDo.getId(), 1L, 5);

        }
        mailService.transportClose(transport);

    }

    private List<OrderRakutenProductDo> getRakutenProductInfoDo(RakutenOrderModel orderModel) {
        List<OrderRakutenProductDo> productInfos = new ArrayList<>();
        for (RakutenOrderModel.PackageModelListEntity.ItemModelListEntity itemModelListEntity :
                orderModel.getPackageModelList().get(0).getItemModelList()) {
            OrderRakutenProductDo productInfo = new OrderRakutenProductDo();
            BeanUtils.copyProperties(itemModelListEntity, productInfo);
            productInfo.setPrice(itemModelListEntity.getPrice());
            productInfos.add(productInfo);
        }
        return productInfos;
    }

    private OrderRakutenPackageDo getRakutenPackageDO(RakutenOrderModel orderModel) {
        OrderRakutenPackageDo rakutenPackageInfo = new OrderRakutenPackageDo();
        RakutenOrderModel.PackageModelListEntity packageModelListEntity = orderModel.getPackageModelList().get(0);
        //收货人信息
        BeanUtils.copyProperties(packageModelListEntity, rakutenPackageInfo);
        rakutenPackageInfo.setOrderCity(packageModelListEntity.getSenderModel().getCity());
        rakutenPackageInfo.setOrderSubAddres(packageModelListEntity.getSenderModel().getSubAddress());
//            rakutenPackageInfo.set(packageModelListEntity.getSenderModel().getEmailAddress());
        rakutenPackageInfo.setOrderPhoneNumber(packageModelListEntity.getSenderModel().getPhoneNumber1() + "-" + packageModelListEntity.getSenderModel().getPhoneNumber2() + "-" + packageModelListEntity.getSenderModel().getPhoneNumber3());
        rakutenPackageInfo.setOrderPostCode(packageModelListEntity.getSenderModel().getZipCode1() + "-" + packageModelListEntity.getSenderModel().getZipCode2());
        rakutenPackageInfo.setOrderPrefecture(packageModelListEntity.getSenderModel().getPrefecture());
        rakutenPackageInfo.setOrderName(packageModelListEntity.getSenderModel().getFamilyName() + " " + packageModelListEntity.getSenderModel().getFirstName());
        rakutenPackageInfo.setOrderFamilyNameKana(packageModelListEntity.getSenderModel().getFamilyNameKana());
        rakutenPackageInfo.setOrderFirstNameKana(packageModelListEntity.getSenderModel().getFirstNameKana());
        return rakutenPackageInfo;
    }


    private OrderRakutenDo getRakutenDo(RakutenOrderModel orderModel) {
        OrderRakutenDo rakutenDo = new OrderRakutenDo();
        BeanUtils.copyProperties(orderModel, rakutenDo);
        rakutenDo.setOrderDatetime(replaceStrDateFromat(orderModel.getOrderDatetime()));
        rakutenDo.setOrderFixDatetime(replaceStrDateFromat(orderModel.getOrderFixDatetime()));
        rakutenDo.setShopOrderCfmDatetime(replaceStrDateFromat(orderModel.getShopOrderCfmDatetime()));
        rakutenDo.setShippingInstDatetime(replaceStrDateFromat(orderModel.getShippingInstDatetime()));
        rakutenDo.setShippingCmplRptDatetime(replaceStrDateFromat(orderModel.getShippingCmplRptDatetime()));
        rakutenDo.setRequestPrice((orderModel.getRequestPrice().floatValue()));
        if (!org.springframework.util.StringUtils.isEmpty(orderModel.getShippingTerm())) {
            if (orderModel.getShippingTerm().length() > 3) {
                rakutenDo.setShippingTerm(orderModel.getShippingTerm().substring(0, 2) + "-" + orderModel.getShippingTerm().substring(2));
            } else if (orderModel.getShippingTerm().length() > 1) {
                rakutenDo.setShippingTerm(orderModel.getShippingTerm().substring(0, 1) + "-" + orderModel.getShippingTerm().substring(1));
            }
        }
        String tips = orderModel.getRemarks().replaceAll("\\[配送日時指定:\\]", "").replaceAll("\\n", "");
        if (tips.length() > 100)
            tips = tips.substring(0, 97) + "...";
        rakutenDo.setRemarks(tips);
        rakutenDo.setSystemMemo(orderModel.getMemo());
        //订购人信息
        rakutenDo.setOrderCity(orderModel.getOrdererModel().getCity());
        rakutenDo.setOrderSubAddres(orderModel.getOrdererModel().getSubAddress());
        rakutenDo.setOrderEmailAddress(orderModel.getOrdererModel().getEmailAddress());
        rakutenDo.setOrderPhoneNumber(orderModel.getOrdererModel().getPhoneNumber1() + "-" + orderModel.getOrdererModel().getPhoneNumber2() + "-" + orderModel.getOrdererModel().getPhoneNumber3());
        rakutenDo.setOrderPostCode(orderModel.getOrdererModel().getZipCode1() + "-" + orderModel.getOrdererModel().getZipCode2());
        rakutenDo.setOrderPrefecture(orderModel.getOrdererModel().getPrefecture());
        rakutenDo.setOrderName(orderModel.getOrdererModel().getFamilyName() + " " + orderModel.getOrdererModel().getFirstName());
        rakutenDo.setOrderFamilyNameKana(orderModel.getOrdererModel().getFamilyNameKana());
        rakutenDo.setOrderFirstNameKana(orderModel.getOrdererModel().getFirstNameKana());
        rakutenDo.setOrderBirthday(orderModel.getOrdererModel().getBirthYear() + "-" + orderModel.getOrdererModel().getBirthMonth() + "-" + orderModel.getOrdererModel().getBirthDay());
        rakutenDo.setOrderSex(rakutenDo.getOrderSex());
        //
        if (orderModel.getPointModel() != null)
            rakutenDo.setUsedPoint(orderModel.getPointModel().getUsedPoint());
        if (orderModel.getDeliveryModel() != null)
            rakutenDo.setDeliveryName(orderModel.getDeliveryModel().getDeliveryName());
        if (orderModel.getCouponModelList() != null && orderModel.getCouponModelList().size() > 0) {
            rakutenDo.setUsedCouponTotalPrice(orderModel.getCouponModelList().get(0).couponTotalPrice);
        }
        return rakutenDo;
    }

    private String getInvitationTemplate(Long shopId) {
        try {
            return FreeMarkerUtils.createRakutentInvitationMailTemplate(templatePath + "rakuten_invitation_" + shopId + ".ftl");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(shopId + "发信失败");
            logger.error(e.getMessage());
            //todo 写入异常日志通知顾客
        }
        return "";
    }

    private String getConfirmEmailTemplate(OrderRakutenDo orderModel, OrderRakutenPackageDo orderRakutenPackageDo, List<OrderRakutenProductDo> orderRakutenProductList, Long shopId) {
        try {
            return FreeMarkerUtils.createRakutentConfirmMailTemplate(orderModel, orderRakutenPackageDo, orderRakutenProductList,
                    templatePath + "rakuten_confirm_" + shopId + ".ftl");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(orderModel.getOrderNumber() + "发信失败");
            logger.error(e.getMessage());
            //todo 写入异常日志通知顾客
        }
        return "";
    }

    private String getSendOutEmailTemplate(OrderRakutenDo orderModel, OrderRakutenPackageDo orderRakutenPackageDo,
                                           List<OrderRakutenProductDo> orderRakutenProductList, List<ShippingModelEntity> shippingModelEntity, Long shopId) {
        try {
            return FreeMarkerUtils.createRakutenSendOutMailTemplate(orderModel, orderRakutenPackageDo, orderRakutenProductList,
                    shippingModelEntity, templatePath + "rakuten_sendout_" + shopId + ".ftl");
        } catch (Exception e) {
            e.printStackTrace();
            logger.error(orderModel.getOrderNumber() + "发信失败");
            logger.error(e.getMessage());
            //todo 写入异常日志通知顾客
        }
        return "";
    }

    /**
     * @param shippingModelRequests
     * @param shopId
     * @param secret
     * @param license
     */
    @Override
    public void updateOrderShipping(List<OrderShippingModelRequest> shippingModelRequests, Long shopId, String
            secret, String license) {
        logger.info(String.format("updateOrderShipping:%d 乐天订单开始上传", shopId));
        String authorization = "ESA " + Base64.getEncoder().encodeToString((secret + ":" + license).getBytes());
        logger.debug(authorization);
        String url = GlobalConstants.RakutenURL + "/order/updateOrderShippingAsync/";
        JSONObject order = new JSONObject();
        order.put("OrderShippingModelList", shippingModelRequests);
        logger.info(order.toJSONString());
        String jsonData = OkHttpUtils.okHttpRequestPost(url, HttpMethod.POST.name(), order.toJSONString(), authorization);
        JSONObject object = JSONObject.parseObject(jsonData);
        logger.info(jsonData);
        try {
            if ("ORDER_EXT_API_UPDATE_ORDERSHIPPING_ASYNC_INFO_101".equals(
                    object.getJSONArray("MessageModelList").getJSONObject(0).getString("messageCode"))) {

            } else {
                //todo 处理上传运单号失败的情况
                logger.error(object.getJSONArray("MessageModelList").toString());
                return;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }
        logger.info(String.format("updateOrderShipping:%d:乐天订单上传完成", shopId));
        logger.info(String.format("mailService:%d:乐天订单开始配信", shopId));
        Session session = mailService.initRakutenMailSession();
        Transport transport = null;
        if (shopId == 4) {
            transport = mailService.initRakutenMailTransport(session);
        } else if (shopId == 28) {
            transport = mailService.initRakutenMailTransport(session, "382120", "1kNt34Tydu");
        } else if (shopId == 20) {
            transport = mailService.initRakutenMailTransport(session, "405296", "BTO8mJ8Xnc");
        } else if (shopId.intValue() == 106) {
            transport = mailService.initRakutenMailTransport(session, "382110", "l1baRYIl7t");
        } else if (shopId.intValue() == 304) {
            transport = mailService.initRakutenMailTransport(session, "398853", "BOLVP3nik3");
        } else if (shopId.intValue() == 338) {
            transport = mailService.initRakutenMailTransport(session, "381806", "8PR6YFmoUv");
        } else if (shopId.intValue() == 395) {
            transport = mailService.initRakutenMailTransport(session, "408139", "sOSLaMxeqf");
        } else if (shopId.intValue() == 456) {
            transport = mailService.initRakutenMailTransport(session, "411637", "0BC2qpttzF");
        } else if (shopId.intValue() == 363) {
            transport = mailService.initRakutenMailTransport(session, "416163", "aH7I1qDxiZ");
        } else if (shopId.intValue() == 292) {
            transport = mailService.initRakutenMailTransport(session, "420012", "V9M8DhggHx");
        } else if (shopId.intValue() == 518) {
            transport = mailService.initRakutenMailTransport(session, "394190", "OdBkeAyepr");
        } else if (shopId.intValue() == 519) {
            transport = mailService.initRakutenMailTransport(session, "411152", "H8NDza3uV7");
        } else if (shopId.intValue() == 515) {
            transport = mailService.initRakutenMailTransport(session, "370720", "POan1u4rzR");
        } else if (shopId.intValue() == 432) {
            transport = mailService.initRakutenMailTransport(session, "422396", "XSyddkbhPn");
        } else {
            transport = mailService.initRakutenMailTransport(session, "377156", "D7TXygKGZ6");
        }
//        Session session = mailService.initMailSession();
//        Transport transport = mailService.initMailTransport(session);
        for (OrderShippingModelRequest request :
                shippingModelRequests) {
            QueryWrapper queryWrapper = new QueryWrapper();
            queryWrapper.eq("order_number", request.getOrderNumber());
            queryWrapper.last("limit 1");
            OrderRakutenDo rakutenDo = dao.selectOne(queryWrapper);
            updateRakutenOrderSendOut(request.getOrderNumber());
            operateRecordDao.operateAddRecord(SysConstant.OPERATE_UPLOAD_TRACK, rakutenDo.getId(), 1L, 5);
            if (rakutenDo.getIsSendMail() == 1) {
                continue;
            }
            try {
                Thread.sleep(3 * 1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            //todo 配信   freemaker
            QueryWrapper packageWrapper = new QueryWrapper();
            packageWrapper.eq("order_id", rakutenDo.getId());
            List<OrderRakutenPackageDo> orderRakutenPackageDoList = packageDao.selectList(packageWrapper);
            for (int i = 0; i < orderRakutenPackageDoList.size(); i++) {
                OrderRakutenPackageDo orderRakutenPackageDo = orderRakutenPackageDoList.get(i);
                QueryWrapper productWrapper = new QueryWrapper();
                productWrapper.eq("basket_id", orderRakutenPackageDo.getBasketId());
                List<OrderRakutenProductDo> orderRakutenProductList = productDao.selectList(productWrapper);
                switch (rakutenDo.getShopId().intValue()) {
                    case 4:
                        mailService.sendEmailRakuten(session, transport, "【MWPO】商品発送完了のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId)
                                , rakutenDo.getOrderEmailAddress(), "rakuten_service@sanchoum.com", "text/html;charset=Shift-JIS");
                        break;
                    case 28:
                        mailService.sendEmailRakuten(session, transport, "【FUTATABI】商品発送完了のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId)
                                , rakutenDo.getOrderEmailAddress(), "futatabi@sanchoum.com", "futatabi@sanchoum.com", "text/html;charset=Shift-JIS");
                        break;
                    case 44:
                        mailService.sendEmailRakuten(session, transport, "【OneTigris Camping楽天市場店】商品発送完了のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress()
                                , "kuma@onetigris.com", "icey@onetigris.com", "text/html;charset=Shift-JIS");
                        break;
                    case 106:
                        mailService.sendEmailRakuten(session, transport, "【イオドウス楽天市場店】商品発送完了のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress()
                                , "yasuyoshi@sanchoum.com", "text/html;charset=Shift-JIS");
                        break;
                    case 304:
                        mailService.sendEmailRakuten(session, transport, "【titilife】商品発送完了のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress()
                                , "titilife@hakyuuoku.com", "text/html;charset=Shift-JIS");
                        break;
                    case 338:
                        mailService.sendEmailRakuten(session, transport, "【Maydolly楽天市場店】商品発送のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress()
                                , "maydolly@tongzhou-ec.com", "maydolly@tongzhou-ec.com", "text/html;charset=Shift-JIS");
                        break;
                    case 395:
                        mailService.sendEmailRakuten(session, transport, "【楽天 Greatstar Official】商品発送のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress()
                                , "rakuten.jp@greatstartools.com", "greatstarofficial@shop.rakuten.co.jp", "text/html;charset=Shift-JIS");
                        break;
                    case 456:
                        mailService.sendEmailRakuten(session, transport, "【楽天 MamimamiHome】商品発送のお知らせ",
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress()
                                , "rakuten_kyo@ywshsdzswyxgs.wecom.work", "text/html;charset=Shift-JIS");
                        break;
                    case 363:
                        mailService.sendEmailRakuten(session, transport, String.format("【楽天 %s】商品発送のお知らせ", "Fortella"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId),
                                rakutenDo.getOrderEmailAddress(), "service@fortellababy.com"
                                , "text/html;charset=Shift-JIS");
                        break;
                    case 292:
                        mailService.sendEmailRakuten(session, transport, String.format("【楽天 %s】商品発送のお知らせ", "Hardware Factory Store"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId),
                                rakutenDo.getOrderEmailAddress(), "shirley@hfsus.com"
                                , "text/html;charset=Shift-JIS");
                        break;
                    case 518:
                        mailService.sendEmailRakuten(session, transport, String.format("【%s】荷物発送のご案内", "Kiboer"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId),
                                rakutenDo.getOrderEmailAddress(), "kiboer@dws789.com"
                                , "text/html;charset=Shift-JIS");
                        break;
                    case 519:
                        mailService.sendEmailRakuten(session, transport, String.format("【%s】荷物発送のご案内", "Kiboerュウカショップ"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId),
                                rakutenDo.getOrderEmailAddress(), "support@kiboer.com"
                                , "text/html;charset=Shift-JIS");
                        break;
                    case 515:
                        mailService.sendEmailRakuten(session, transport, String.format("【%s】商品発送のご案内について", "Chende"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId),
                                rakutenDo.getOrderEmailAddress(), "chende@dws789.com"
                                , "text/html;charset=Shift-JIS");
                        break;
                        case 432:
                        mailService.sendEmailRakuten(session, transport, String.format("【%s】商品発送のお知らせ!", "Lyncohome"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId),
                                rakutenDo.getOrderEmailAddress(), "rakutenop@lyncohome.com"
                                , "text/html;charset=Shift-JIS");
                        break;
                    case 20:
                        mailService.sendEmailRakuten(session, transport, String.format("【楽天 %s】商品発送のお知らせ！", "magichut"),
                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
                                        request.getBasketidModelList().get(0).getShippingModelList(), shopId), rakutenDo.getOrderEmailAddress(),
                                "sanwamirai@e-mail.jp", "text/html;charset=Shift-JIS");
                    default:
//                        mailService.sendEmail(session, transport, String.format("【" + shopDao.selectById(shopId).getShopName() + "】商品発送完了未找到对应店铺信息"),
//                                getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
//                                        request.getBasketidModelList().get(0).getShippingModelList().get(0), shopId),
//                                "770403372@qq.com");
                }
            }
//            logger.debug(getSendOutEmailTemplate(rakutenDo, orderRakutenPackageDo, orderRakutenProductList,
//                    request.getBasketidModelList().get(0).getShippingModelList().get(0), shopId));
            logger.info(String.format("mailService:%d:乐天订单配信完成", shopId));
            updateRakutenOrderSendMail(request.getOrderNumber());
            operateRecordDao.operateAddRecord(SysConstant.OPERATE_SEND_MAIL_OUT, rakutenDo.getId(), 1L, 5);
            logger.info(String.format("updateShipping:%d:乐天订单修改本地订单状态完成", shopId));
        }
        mailService.transportClose(transport);
    }

    private void updateRakutenOrderSendOut(String orderNumber) {
        UpdateWrapper wrapper = new UpdateWrapper();
        wrapper.eq("order_number", orderNumber);
        wrapper.set("is_upload_express", 1);
        update(wrapper);

    }

    private void updateRakutenOrderSendMail(String orderNumber) {
        UpdateWrapper wrapper = new UpdateWrapper();
        wrapper.eq("order_number", orderNumber);
        wrapper.set("is_send_mail", 1);
        update(wrapper);

    }

    @Override
    public void exportExcel(Map<String, String> map, List<Long> ids, HttpServletResponse response) throws IOException {
        List<OrderRakutenDo> orderRakutenDoList = new ArrayList<>();
        if (ids == null || ids.size() < 1) {
            QueryWrapper<OrderRakutenDo> wrapper = queryBuild(map);
            orderRakutenDoList = this.baseMapper.selectList(wrapper);
        } else {
            orderRakutenDoList = this.baseMapper.selectBatchIds(ids);
        }
        if (orderRakutenDoList.size() > 1000) {
            response.sendError(500, "数据超过1000条，请分日期导出");
            throw new BizException(SysConstant.File_Export_ToMuch, 1000);
        }
        List<OrderRakutenExcelExportVo> excelExportVoList = new ArrayList<>();

        if (!CollectionUtils.isEmpty(orderRakutenDoList)) {
            for (OrderRakutenDo rakutenDo : orderRakutenDoList) {
                OrderRakutenExcelExportVo excelExportVo = new OrderRakutenExcelExportVo();
                BeanUtils.copyProperties(rakutenDo, excelExportVo);

                LambdaQueryWrapper<OrderRakutenPackageDo> packageDoLambdaQueryWrapper = new LambdaQueryWrapper<>();
                packageDoLambdaQueryWrapper.eq(OrderRakutenPackageDo::getOrderId, rakutenDo.getId());
                List<OrderRakutenPackageDo> packageDoList = packageDao.selectList(packageDoLambdaQueryWrapper);
                if (!CollectionUtils.isEmpty(packageDoList)) {
                    List<OrderRakutenPackageExcelExportVo> packageExcelExportVoList = new ArrayList<>();
                    for (OrderRakutenPackageDo packageDo : packageDoList) {
                        OrderRakutenPackageExcelExportVo packageExcelExportVo = new OrderRakutenPackageExcelExportVo();
                        BeanUtils.copyProperties(packageDo, packageExcelExportVo);

                        LambdaQueryWrapper<OrderRakutenProductDo> productDoLambdaQueryWrapper = new LambdaQueryWrapper<>();
                        productDoLambdaQueryWrapper.eq(OrderRakutenProductDo::getBasketId, packageDo.getBasketId());
                        List<OrderRakutenProductDo> productDoList = productDao.selectList(productDoLambdaQueryWrapper);
                        if (!CollectionUtils.isEmpty(productDoList)) {
                            List<OrderRakutenProductExcelExportVo> productExcelExportVoList = new ArrayList<>();
                            for (OrderRakutenProductDo productDo : productDoList) {
                                OrderRakutenProductExcelExportVo productExcelExportVo = new OrderRakutenProductExcelExportVo();
                                BeanUtils.copyProperties(productDo, productExcelExportVo);
                                productExcelExportVoList.add(productExcelExportVo);
                            }
                            packageExcelExportVo.setProductExcelExportVoList(productExcelExportVoList);
                        }
                        packageExcelExportVoList.add(packageExcelExportVo);
                    }
                    excelExportVo.setPackageExcelExportVoList(packageExcelExportVoList);
                }
                excelExportVoList.add(excelExportVo);
            }
        }
        ExportParams exportParams = new ExportParams();
        exportParams.setCreateHeadRows(true);
        exportParams.setHeaderColor(IndexedColors.YELLOW.getIndex());
        ExcelUtils.exportExcel(excelExportVoList, OrderRakutenExcelExportVo.class, "乐天订单", exportParams, response);
    }

    /**
     * 验证该店铺是否有APItoken
     *
     * @param shopId
     * @return
     */
    private ShopDo verifyShopTokenExist(long shopId) {
        ShopDo shopBean = mShopService.getShopTokenById(shopId);
        if (StringUtils.isEmpty(shopBean.getRakutenLicense()) || StringUtils.isEmpty(shopBean.getRakutenSecret())) {
            throw new BizException(SysConstant.Shop_Token_Error);
        }
        if (shopBean.getKeyStatus() != 1) {
            throw new BizException(SysConstant.Shop_Token_Error);
        }
        return shopBean;
    }

    @Override
    public SingleResult sendOutMatch(List<OrderOutputAddReq> orderOutputAddReqList, Long userId, Long companyId) {
        List<String> failOrders = outputService.addRakutenList(orderOutputAddReqList, userId);
        if (failOrders.size() > 0) {
//            return SingleResult.failure("300", String.format("成功导出%d个发货单", orderOutputAddReqList.size() - failOrders.size()), failOrders);
            return SingleResult.failure("300", SysConstant.OrderYahoo_Export_Success, failOrders, orderOutputAddReqList.size() - failOrders.size());
        } else {
            return SingleResult.success(failOrders);
        }
    }

    /**
     * 转到发货单
     *
     * @param orderids
     * @param currentUserId
     * @param b
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)//事务回滚
    public SingleResult queryOrder2SendOut(String[] orderids, Long currentUserId, boolean b) {

        List<OrderOutputAddReq> orderOutputAddReqList = new ArrayList<>();
        List<String> failOrders = new ArrayList<>();
        for (String orderid :
                orderids) {
            List<OrderOutputAddReq> outputAddReqs = new ArrayList<>();
            try {
                outputAddReqs = sendOutOrder(orderid, b);
            } catch (BizException e) {
                e.printStackTrace();
                failOrders.add(StringsUtil.createI18Message(e.getMessage(), e.getArgs()));
            }
            if (outputAddReqs.size() < 1) continue;
            orderOutputAddReqList.addAll(outputAddReqs);
            operateRecordDao.operateAddRecord(b ? SysConstant.OPERATE_AUTO_SEND : SysConstant.OPERATE_CLICK_SEND, Long.parseLong(orderid), currentUserId, 5);

//            operateRecord( "自动发货" : "点击发货", Long.parseLong(orderid), currentUserId);
        }
        if (b) {
            failOrders.addAll(outputService.addRakutenList(orderOutputAddReqList, currentUserId));
        }
        for (int i = 0; i < orderOutputAddReqList.size(); i++) {
            OrderOutputAddReq outputAddReq = orderOutputAddReqList.get(i);
            StringBuilder sku = new StringBuilder();
            int cout = 0;
            for (OrderOutputProductAddReq orderOutputProductAddReq : outputAddReq.getPackageList().get(0).getProductList()) {
                cout = cout + orderOutputProductAddReq.getCount();
                if (org.apache.commons.lang3.StringUtils.isNotBlank(sku)) {
                    sku.append(",");
                }
                sku.append(productInfoDao.selectById(orderOutputProductAddReq.getProductId()).getCommoditySku());
            }
            outputAddReq.setIndex(i + 1);
            outputAddReq.setSku(sku.toString());
            outputAddReq.setCount(cout);
        }
        logger.debug(JSONObject.toJSONString(orderOutputAddReqList));
        logger.info(JSONObject.toJSONString(failOrders));
        Map map = new HashMap();
        map.put("orderList", orderOutputAddReqList);
        map.put("failedList", failOrders);
        map.put("storageList", storageDao.selectList(null));
        return SingleResult.success(map);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)//事务回滚
    public SingleResult queryOrder2SendOutNoPackage(String orderid, Long currentUserId, boolean b, Long companyId) {
        //校验余额是否不足
//        sufficientFundsCheck(companyId);
        List<String> failOrders = new ArrayList<>();
        List<OrderOutputAddReq> orderOutputAddReqList = new ArrayList<>();
        try {
            OrderRakutenDo rakutenDo = this.baseMapper.selectById(orderid);
            if (rakutenDo == null) {
                throw new BizException(SysConstant.Order_NotExist1);
            }
            if (rakutenDo.getOrderProgress() == 900) {
                throw new BizException(SysConstant.OrderYahoo_Canceled_OrderId, rakutenDo.getOrderNumber());
            }
            //订单
            OrderOutputAddReq res = new OrderOutputAddReq();
            res.setPlatformNumber("rakuten");
            res.setPlatformNumber(rakutenDo.getId() + "");
            res.setSendDate(new Date());
            res.setShopId(rakutenDo.getShopId());
            res.setCompanyId(rakutenDo.getCompanyId());
            res.setOrderNo(rakutenDo.getOrderNumber());
            res.setTips(rakutenDo.getRemarks());

            res.setDeliveryDate(rakutenDo.getDeliveryDate());
            if ("1".equals(rakutenDo.getShippingTerm())) {
                res.setDeliveryTime("09-12");
            } else {
                res.setDeliveryTime(rakutenDo.getShippingTerm());
            }
            res.setShipmentType(rakutenDo.getAsurakuFlag());//乐天次日达
            QueryWrapper<OrderRakutenPackageDo> wrapper = new QueryWrapper<>();
            wrapper.eq("order_id", orderid);
            List<OrderRakutenPackageDo> packageDoList = packageDao.selectList(wrapper);
            if (packageDoList == null || packageDoList.size() < 1) {
                throw new BizException(SysConstant.Order_NoPackage, rakutenDo.getOrderNumber());
            }
            if (rakutenDo.getSomeSenderFlag() == null || rakutenDo.getSomeSenderFlag() == 0) {
                OrderRakutenPackageDo packageDo = packageDoList.get(0);//乐天默认一个包裹
                res.setReceiverName(packageDo.getOrderName());
                res.setTelPhone(packageDo.getOrderPhoneNumber());
                res.setPostCode(packageDo.getOrderPostCode());
                res.setArea(packageDo.getOrderPrefecture());
                res.setAddress(packageDo.getOrderCity() + packageDo.getOrderSubAddres());
                res.setCod(res.getCod());
                QueryWrapper<OrderRakutenProductDo> productDoQueryWrapper = new QueryWrapper<>();
                productDoQueryWrapper.eq("basket_id", packageDo.getBasketId());
                List<OrderRakutenProductDo> productDoList = productDao.selectList(productDoQueryWrapper);
                List<OrderOutputProductAddReq> productAddList = new ArrayList<>();
                if (productDoList == null || productDoList.size() < 1) {
                    throw new BizException(SysConstant.Order_NoSku, rakutenDo.getOrderNumber());
                }
                double[] size = new double[4];
                long storageId = 0L;
                double shipPirce = 99999D;
                for (OrderRakutenProductDo productDo :
                        productDoList) {
                    List<OrderOutputAddReq> resList = new ArrayList<>();
                    List<StorageDo> storageDoList = storageDao.selectList(null);
                    Long productId = getProductId(productDo.getItemNumber(), rakutenDo.getCompanyId());
                    for (StorageDo storageDo : storageDoList) {//遍历仓库是否都有库存
                        LambdaQueryWrapper<StockRecordDo> wrapper2 = new LambdaQueryWrapper();
                        size = shipPriceService.countSameSkuSize(new double[4], productId, 1);
                        wrapper2.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                                .eq(StockRecordDo::getProductInfoId, productId)
                                .eq(StockRecordDo::getStorageId, storageDo.getId());
                        StockRecordDo stockRecordDo1 = stockDao.selectOne(wrapper2);
                        int noDeliveredCount1 = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageDo.getId());
                        if (stockRecordDo1 != null && stockRecordDo1.getCanSellCount() - noDeliveredCount1 > 0) {
                            List<ShipPriceDo> shipPriceDos = shipPriceService.queryByRegionAndSize(packageDo.getOrderPostCode(),
                                    size[3], size[0] + size[1] + size[2], size[0], size[1], size[2], res.getCod(), res.getShipmentType(), storageDo.getId(), 1);
                            if (shipPriceDos.size() < 1 || shipPriceDos.get(0).getPrice() == 0) continue;
                            if (shipPirce > shipPriceDos.get(0).getPrice()) {//选择最便宜的价格
                                shipPirce = shipPriceDos.get(0).getPrice();
                                storageId = storageDo.getId();
                            }
                        }
                    }

                    OrderOutputProductAddReq productDetail = new OrderOutputProductAddReq();
                    productDetail.setProductId(productId);
                    productDetail.setCount(productDo.getUnits());
                    productAddList = new ArrayList<>();
                    productAddList.add(productDetail);
                    OrderOutputPackageAddReq packageDetail = new OrderOutputPackageAddReq();
                    packageDetail.setProductList(productAddList);
                    OrderOutputAddReq addReq = new OrderOutputAddReq();
                    BeanUtils.copyProperties(res, addReq);
                    List<OrderOutputPackageAddReq> packageAddReqList = new ArrayList<>();
                    packageAddReqList.add(packageDetail);
                    addReq.setStorageId(storageId);
                    addReq.setPackageList(packageAddReqList);
                    if (storageId == 0) {
                        failOrders.add(StringsUtil.createI18Message(SysConstant.Product_Stock_NotEnough, productDo.getItemNumber()));
                    } else {
                        resList.add(addReq);
                    }
                    orderOutputAddReqList.addAll(resList);
                }
            }
        } catch (BizException e) {
            e.printStackTrace();
            failOrders.add(StringsUtil.createI18Message(e.getMessage(), e.getArgs()));
        }
//            Session session = mailService.initMailSession();
//            Transport transport = mailService.initMailTransport(session);
        operateRecordDao.operateAddRecord(SysConstant.OPERATE_CLICK_SEND, Long.parseLong(orderid), currentUserId, 5);
//        List<String> failOrders = new ArrayList<>();

        for (OrderOutputAddReq outputAddReq : orderOutputAddReqList) {
            StringBuilder sku = new StringBuilder();
            int cout = 0;
            for (OrderOutputProductAddReq orderOutputProductAddReq : outputAddReq.getPackageList().get(0).getProductList()) {
                cout = cout + orderOutputProductAddReq.getCount();
                if (org.apache.commons.lang3.StringUtils.isNotBlank(sku)) {
                    sku.append(",");
                }
                sku.append(productInfoDao.selectById(orderOutputProductAddReq.getProductId()).getCommoditySku());
            }
            outputAddReq.setSku(sku.toString());
            outputAddReq.setCount(cout);
        }
        Map map = new HashMap();
        map.put("orderList", orderOutputAddReqList);
        map.put("failedList", failOrders);
        map.put("storageList", storageDao.selectList(null));
        return SingleResult.success(map);
    }

    private List<OrderOutputAddReq> sendOutOrder(String orderid, boolean b) {
        OrderRakutenDo rakutenDo = this.baseMapper.selectById(orderid);
        if (rakutenDo == null) {
            throw new BizException(SysConstant.Order_NotExist1);
        }
        if (rakutenDo.getOrderProgress() == 900) {
            throw new BizException(SysConstant.OrderYahoo_Canceled_OrderId, rakutenDo.getOrderNumber());
        }
        if (b && rakutenDo.getCompanyId() == 1 && StringUtils.isNotBlank(rakutenDo.getRemarks())) {
            throw new BizException(SysConstant.Order_AutoSend_Error, rakutenDo.getOrderNumber());
        }
        if (b && (rakutenDo.getIsSendOut()) == 1) {
            throw new BizException(SysConstant.Order_AutoSend_Error, rakutenDo.getOrderNumber());
        }
        List<OrderOutputAddReq> resList = new ArrayList<>();
        //订单
        OrderOutputAddReq res = new OrderOutputAddReq();
        res.setPlatformNumber("rakuten");
        res.setPlatformNumber(rakutenDo.getId() + "");
        res.setSendDate(new Date());
        res.setShopId(rakutenDo.getShopId());
        res.setCompanyId(rakutenDo.getCompanyId());
        res.setOrderNo(rakutenDo.getOrderNumber());
        res.setShipmentType(rakutenDo.getAsurakuFlag());//乐天次日达
        if ("1".equals(rakutenDo.getShippingTerm())) {
            res.setDeliveryTime("09-12");
        } else {
            res.setDeliveryTime(rakutenDo.getShippingTerm());
        }
        QueryWrapper<OrderRakutenPackageDo> wrapper = new QueryWrapper<>();
        wrapper.eq("order_id", orderid);
        List<OrderRakutenPackageDo> packageDoList = packageDao.selectList(wrapper);
        if (packageDoList == null || packageDoList.size() < 1) {
            throw new BizException(SysConstant.Order_NoPackage, rakutenDo.getOrderNumber());
        }
        if (rakutenDo.getSomeSenderFlag() == null || rakutenDo.getSomeSenderFlag() == 0) {
            OrderRakutenPackageDo packageDo = packageDoList.get(0);//乐天默认一个包裹
            res.setReceiverName(packageDo.getOrderName() + " 様");
            res.setTelPhone(packageDo.getOrderPhoneNumber());
            res.setPostCode(packageDo.getOrderPostCode());
            res.setArea(packageDo.getOrderPrefecture());
            res.setAddress(packageDo.getOrderCity() + packageDo.getOrderSubAddres());
            if (packageDo.getDeliveryPrice() > 0) {
                res.setCod(rakutenDo.getRequestPrice().intValue());
            }
            if (rakutenDo.getCompanyId() == 201) {
                if (packageDo.getDefaultDeliveryCompanyCode() != null)
                    if (packageDo.getDefaultDeliveryCompanyCode().equals("1001"))
                        res.setTrackId(DicBusinessItemConstant.yamatoExpress);
                    else
                        res.setTrackId(DicBusinessItemConstant.sagawaExpress);
            }
            QueryWrapper<OrderRakutenProductDo> productDoQueryWrapper = new QueryWrapper<>();
            productDoQueryWrapper.eq("basket_id", packageDo.getBasketId());
            List<OrderRakutenProductDo> productDoList = productDao.selectList(productDoQueryWrapper);
            List<OrderOutputProductAddReq> productAddList = new ArrayList<>();
            if (productDoList == null || productDoList.size() < 1) {
                throw new BizException(SysConstant.Order_NoSku, rakutenDo.getOrderNumber());
            }
            double[] size = new double[4];
            Double shipPirce = 99999d;
            Long storageId = 0L;
            //一单一个产品
            if (productDoList.size() == 1 && productDoList.get(0).getUnits() == 1) {
                Long productId = getProductId(productDoList.get(0).getItemNumber(), rakutenDo.getCompanyId());
                if (productId == null) {
                    throw new BizException(SysConstant.OrderYahoo_Product_Notfound, rakutenDo.getOrderNumber(), productDoList.get(0).getItemNumber());
                }
                size = shipPriceService.countSameSkuSize(size, productId, productDoList.get(0).getUnits());
                Long stateId = mRegionService.getStateIdByPostCode(packageDo.getOrderPostCode());
                if (rakutenDo.getCompanyId() != 1 || rakutenDo.getAsurakuFlag() != 1) {
                    if (stateId <= 8) {//大阪地区优先发货仓库
                        storageId = 12L;
                    } else if (stateId > 9) {//东京仓库优先发货仓库
                        storageId = 10L;
                    }
                } else {
                    storageId = 12L;
                }
                LambdaQueryWrapper<StockRecordDo> wrapper1 = new LambdaQueryWrapper();
                wrapper1.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                        .eq(StockRecordDo::getProductInfoId, productId)
                        .eq(StockRecordDo::getStorageId, storageId);
                StockRecordDo stockRecordDo = stockDao.selectOne(wrapper1);
                int noDeliveredCount = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageId);
                if (stockRecordDo != null && stockRecordDo.getCanSellCount() - noDeliveredCount > 0) {//优先仓库有库存，优先仓库发货

                } else {
                    storageId = 0L;
                    List<StorageDo> storageDos = storageDao.selectList(null);
                    for (StorageDo storageDo : storageDos) {//遍历仓库是否都有库存
                        LambdaQueryWrapper<StockRecordDo> wrapper2 = new LambdaQueryWrapper();
                        wrapper2.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                                .eq(StockRecordDo::getProductInfoId, productId)
                                .eq(StockRecordDo::getStorageId, storageDo.getId());
                        StockRecordDo stockRecordDo1 = stockDao.selectOne(wrapper2);
                        size = shipPriceService.countSameSkuSize(new double[4], productId, productDoList.get(0).getUnits());
                        int noDeliveredCount1 = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageDo.getId());
                        if (stockRecordDo1 != null && stockRecordDo1.getCanSellCount() - noDeliveredCount1 >= productDoList.get(0).getUnits()) {
                            List<ShipPriceDo> shipPriceDos = shipPriceService.queryByRegionAndSize(packageDo.getOrderPostCode(),
                                    size[3], size[0] + size[1] + size[2], size[0], size[1], size[2], res.getCod(), res.getShipmentType(), storageDo.getId(), 1);
                            if (shipPriceDos == null || shipPriceDos.size() < 1 || shipPriceDos.get(0).getPrice() == 0)
                                continue;
                            if (shipPirce > shipPriceDos.get(0).getPrice()) {//选择最便宜的价格
                                shipPirce = shipPriceDos.get(0).getPrice();
                                storageId = storageDo.getId();
                            }
                        }
                    }
                }
                if (storageId == 0) {
                    throw new BizException(SysConstant.OrderYahoo_Stock_NotEnough, rakutenDo.getOrderNumber(), productDoList.get(0).getItemNumber());
                }
                OrderOutputProductAddReq productDetail = new OrderOutputProductAddReq();
//                productDetail.setOrderId(productDo.getOrderAmazonId());
//                productDetail.setCommoditySku(getProductId(itemsDo.getSellerSku(), orderAmazonDo.getCompanyId()));
                productDetail.setProductId(productId);
                productDetail.setCount(productDoList.get(0).getUnits());
//                productDetail.setStorageSku(null);

                productAddList.add(productDetail);
//捆包信息
                OrderOutputPackageAddReq packageDetail = new OrderOutputPackageAddReq();

                List<OrderOutputPackageAddReq> packageAddReqList = new ArrayList<>();
                packageDetail.setProductList(productAddList);
                packageAddReqList.add(packageDetail);
                res.setStorageId(storageId);
                res.setPackageList(packageAddReqList);
                resList.add(res);
                return resList;
            } else {
                Long stateId = mRegionService.getStateIdByPostCode(packageDo.getOrderPostCode());
                if (rakutenDo.getCompanyId() != 1 || rakutenDo.getAsurakuFlag() != 1) {
                    if (stateId <= 7) {//大阪地区优先发货仓库
                        storageId = 12L;
                    } else if (stateId >= 8) {//东京仓库优先发货仓库
                        storageId = 10L;
                    }
                }
                List<OrderRakutenProductDo> noStockProductList = new ArrayList<>();
                for (OrderRakutenProductDo productDo :
                        productDoList) {//多个产品判断
                    Long productId = getProductId(productDo.getItemNumber(), rakutenDo.getCompanyId());
                    if (productId == null) {
                        throw new BizException(SysConstant.OrderYahoo_Product_Notfound, rakutenDo.getOrderNumber(), productDoList.get(0).getItemNumber());
                    }
                    ProductInfoDo productInfoDo = productInfoDao.selectById(productId);
                    LambdaQueryWrapper<StockRecordDo> wrapper1 = new LambdaQueryWrapper();
                    wrapper1.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                            .eq(StockRecordDo::getProductInfoId, productId)
                            .eq(StockRecordDo::getStorageId, storageId);
                    StockRecordDo stockRecordDo = stockDao.selectOne(wrapper1);
                    int noDeliveredCount = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageId);
                    if (stockRecordDo == null || stockRecordDo.getCanSellCount() - noDeliveredCount < productDo.getUnits()) {
//                            if (stockMap.get(storageDo.getId()) == null) {
//                                stockMap.put(storageDo.getId(), new ArrayList<>());
//                            }
//                            stockMap.get(storageDo.getId()).add(stockRecordDo);
                        noStockProductList.add(productDo);
                        continue;
                    }
//                    });
                    OrderOutputProductAddReq productDetail = new OrderOutputProductAddReq();
                    productDetail.setProductId(productId);
                    productDetail.setCount(productDo.getUnits());
                    productAddList.add(productDetail);

                }
                OrderOutputPackageAddReq packageDetail = new OrderOutputPackageAddReq();
                List<OrderOutputPackageAddReq> packageAddReqList = new ArrayList<>();
                packageDetail.setProductList(productAddList);
                OrderOutputAddReq addReq = new OrderOutputAddReq();
                BeanUtils.copyProperties(res, addReq);
                packageAddReqList.add(packageDetail);
                addReq.setStorageId(storageId);
                addReq.setPackageList(packageAddReqList);
                resList.add(addReq);
                //一个仓库是否发完所有订单
                if (noStockProductList.size() > 0) {
                    if (noStockProductList.size() == 1 && noStockProductList.get(0).getUnits() == 1) {
                        storageId = 0L;
                        Long productId = getProductId(noStockProductList.get(0).getItemNumber(), rakutenDo.getCompanyId());
                        List<StorageDo> storageDos = storageDao.selectList(null);
                        shipPirce = 99999D;
                        for (StorageDo storageDo : storageDos) {//遍历仓库是否都有库存

                            LambdaQueryWrapper<StockRecordDo> wrapper2 = new LambdaQueryWrapper();
                            wrapper2.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                                    .eq(StockRecordDo::getProductInfoId, productId)
                                    .eq(StockRecordDo::getStorageId, storageDo.getId());
                            StockRecordDo stockRecordDo1 = stockDao.selectOne(wrapper2);
                            size = shipPriceService.countSameSkuSize(new double[4], productId, productDoList.get(0).getUnits());
                            int noDeliveredCount1 = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageDo.getId());
                            if (stockRecordDo1 != null && stockRecordDo1.getCanSellCount() - noDeliveredCount1 > 0) {
                                List<ShipPriceDo> shipPriceDos = shipPriceService.queryByRegionAndSize(packageDo.getOrderPostCode(),
                                        size[3], size[0] + size[1] + size[2], size[0], size[1], size[2], res.getCod(), res.getShipmentType(), storageDo.getId(), 1);
                                if (shipPriceDos.size() < 1 || shipPriceDos.get(0).getPrice() == 0) continue;
                                if (shipPirce > shipPriceDos.get(0).getPrice()) {//选择最便宜的价格
                                    shipPirce = shipPriceDos.get(0).getPrice();
                                    storageId = storageDo.getId();
                                }
                            }
                        }
                        OrderOutputProductAddReq productDetail = new OrderOutputProductAddReq();
                        productDetail.setProductId(productId);
                        productDetail.setCount(noStockProductList.get(0).getUnits());
                        productAddList.add(productDetail);
                        OrderOutputPackageAddReq packageDetail1 = new OrderOutputPackageAddReq();
                        if (storageId == 0) {
                            throw new BizException(SysConstant.OrderYahoo_Stock_NotEnough, rakutenDo.getOrderNumber(), noStockProductList.get(0).getItemNumber());
                        }
                        List<OrderOutputPackageAddReq> packageAddReqList1 = new ArrayList<>();
                        packageDetail1.setProductList(productAddList);
                        OrderOutputAddReq addReq1 = new OrderOutputAddReq();
                        BeanUtils.copyProperties(res, addReq1);
                        packageAddReqList1.add(packageDetail1);
                        addReq1.setStorageId(storageId);
                        addReq1.setPackageList(packageAddReqList1);
                        resList.add(addReq1);
                        return resList;
                    } else {
                        List<OrderRakutenProductDo> productDoListFailed = new ArrayList<>();
                        LambdaQueryWrapper<StorageDo> lambdaQueryWrapper = new LambdaQueryWrapper();
                        lambdaQueryWrapper.eq(StorageDo::getSupportShip, 1).ne(StorageDo::getId, storageId);
                        List<StorageDo> storageDos = storageDao.selectList(lambdaQueryWrapper);
                        storageId = 0L;
                        if (storageDos != null) {
                            StorageDo storageDo = storageDos.get(0);//遍历支持捆包仓库是否都有库存
                            for (OrderRakutenProductDo productDo :
                                    noStockProductList) {
                                Long productId = getProductId(productDo.getItemNumber(), rakutenDo.getCompanyId());
                                LambdaQueryWrapper<StockRecordDo> wrapper1 = new LambdaQueryWrapper();
                                wrapper1.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                                        .eq(StockRecordDo::getProductInfoId, productId)
                                        .ne(StockRecordDo::getStorageId, storageId)
                                        .eq(StockRecordDo::getStorageId, storageDo.getId());
                                StockRecordDo stockRecordDo = stockDao.selectOne(wrapper1);
                                int noDeliveredCount = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageDo.getId());

                                if (stockRecordDo == null || stockRecordDo.getCanSellCount() - noDeliveredCount < productDo.getUnits()) {
                                    productDoListFailed.add(productDo);
                                    continue;
                                }
                                OrderOutputProductAddReq productDetail = new OrderOutputProductAddReq();
                                productDetail.setProductId(productId);
                                productDetail.setCount(noStockProductList.get(0).getUnits());
                                productAddList.add(productDetail);

                            }
                            packageDetail = new OrderOutputPackageAddReq();
                            List<OrderOutputPackageAddReq> packageAddReqList1 = new ArrayList<>();
                            packageDetail.setProductList(productAddList);
                            OrderOutputAddReq addReq1 = new OrderOutputAddReq();
                            BeanUtils.copyProperties(res, addReq1);
                            packageAddReqList1.add(packageDetail);
                            addReq1.setStorageId(storageId);
                            addReq1.setPackageList(packageAddReqList1);
                            resList.add(addReq1);
                        } else {
                            productDoListFailed.addAll(noStockProductList);
                        }
                        if (productDoListFailed.size() > 0) {//捆包仓库无库存，分别发
                            LambdaQueryWrapper<StorageDo> queryWrapper = new LambdaQueryWrapper<>();
                            queryWrapper.eq(StorageDo::getSupportShip, 0);
                            List<StorageDo> storageDoList = storageDao.selectList(queryWrapper);
                            StringBuilder stringBuilder = new StringBuilder();
                            for (OrderRakutenProductDo productDo :
                                    productDoListFailed) {
                                storageId = 0L;
                                shipPirce = 99999D;
                                Long productId = getProductId(productDo.getItemNumber(), rakutenDo.getCompanyId());
                                for (StorageDo storageDo : storageDoList) {//遍历仓库是否都有库存
                                    LambdaQueryWrapper<StockRecordDo> wrapper2 = new LambdaQueryWrapper<>();
                                    size = shipPriceService.countSameSkuSize(new double[4], productId, 1);
                                    wrapper2.eq(StockRecordDo::getShopId, rakutenDo.getShopId())
                                            .eq(StockRecordDo::getProductInfoId, productId)
                                            .eq(StockRecordDo::getStorageId, storageDo.getId());
                                    StockRecordDo stockRecordDo1 = stockDao.selectOne(wrapper2);
                                    int noDeliveredCount1 = stockDao.getOrderOutCount(productId, rakutenDo.getShopId(), storageDo.getId());
                                    if (stockRecordDo1 != null && stockRecordDo1.getCanSellCount() - noDeliveredCount1 > 0) {
                                        List<ShipPriceDo> shipPriceDos = shipPriceService.queryByRegionAndSize(packageDo.getOrderPostCode(),
                                                size[3], size[0] + size[1] + size[2], size[0], size[1], size[2], res.getCod(), res.getShipmentType(), storageDo.getId(), 1);
                                        if (shipPriceDos.size() < 1 || shipPriceDos.get(0).getPrice() == 0) continue;
                                        if (shipPirce > shipPriceDos.get(0).getPrice()) {//选择最便宜的价格
                                            shipPirce = shipPriceDos.get(0).getPrice();
                                            storageId = storageDo.getId();
                                        }
                                    }
                                }
                                if (storageId == 0) {
                                    stringBuilder.append("(").append(noStockProductList.get(0).getItemNumber()).append(")");
                                }
                                OrderOutputProductAddReq productDetail = new OrderOutputProductAddReq();
                                productDetail.setProductId(productId);
                                productDetail.setCount(productDo.getUnits());
                                productAddList.add(productDetail);
                                packageDetail = new OrderOutputPackageAddReq();

                                packageAddReqList = new ArrayList<>();
                                packageDetail.setProductList(productAddList);
                                addReq = new OrderOutputAddReq();
                                BeanUtils.copyProperties(res, addReq);
                                packageAddReqList.add(packageDetail);
                                addReq.setStorageId(storageId);
                                addReq.setPackageList(packageAddReqList);
                                resList.add(addReq);
                            }
                            if (stringBuilder.length() > 0) {
                                throw new BizException(SysConstant.OrderYahoo_Stock_NotEnough, rakutenDo.getOrderNumber(), stringBuilder.toString());
                            }
                        }
                    }
                }
            }
        } else {
            //多个包裹多个地址
        }
        return resList;
    }

    private Long getProductId(String sellerSku, Long companyId) {
        QueryWrapper productWrapper = new QueryWrapper();
        productWrapper.eq("commodity_sku", sellerSku);
        productWrapper.eq("company_id", companyId);
        ProductInfoDo productInfoDo = productInfoDao.selectOne(productWrapper);
        if (productInfoDo == null) {
            QueryWrapper skuWrapper = new QueryWrapper();
            skuWrapper.eq("sub_sku", sellerSku);
            skuWrapper.eq("company_id", companyId);
            ProductSkuMapDo productSkuMapDo = productSkuMapDao.selectOne(skuWrapper);
            if (productSkuMapDo == null) {
                throw new BizException(SysConstant.FbaOrder_Check_Sku_NotExist, sellerSku);
            }
            return productSkuMapDo.getProductInfoId();
        } else {
            return productInfoDo.getId();
        }
    }

    @Override
    public int setOrderSend(Long[] orderids, Long userId) {
        int count = baseMapper.updateRakutenOrderSend(orderids);
        for (Long orderid : orderids) {
            operateRecordDao.operateAddRecord(SysConstant.OPERATE_MARK_SEND, orderid, userId, 5);

        }
        return count;
    }
//
//    private void operateRecord(String str, Long id, Long userId) {
//        OperateRecordDo operateRecordDo = new OperateRecordDo();
//        operateRecordDo.setDeleteFlag(0);
//        operateRecordDo.setThirdId(id);
//        operateRecordDo.setType(5);
//        operateRecordDo.setOperateBy(userId);
//        operateRecordDo.setOperateTime(new Date());
//        operateRecordDo.setContent(str);
//        operateRecordDao.insert(operateRecordDo);
//    }

    @Override
    public boolean setOrderSysTips(Long orderId, String desc, Long companyId) {
        OrderRakutenDo rakutenOrder = baseMapper.selectById(orderId);
//        if ("1".equals(type)) {
//            //预售是1
////            rakutenOrder.setShipmentType(2);
//            rakutenOrder.setSystemMemo("予約販売" + "  " + desc);
//        } else if ("2".equals(type)) {
//            //刷单是2
////            rakutenOrder.(1);
//            rakutenOrder.setSystemMemo("测评刷单" + "  " + desc);
//        } else {
//            //刷单是2
////            rakutenOrder.setIsDel(1);
//            rakutenOrder.setSystemMemo(desc);
//        }
        if (rakutenOrder == null) {
            throw new BizException(SysConstant.Order_NotExist1);
        }
        rakutenOrder.setSystemMemo(desc);
        updateById(rakutenOrder);
        return true;
    }


    @Override
    public SingleResult updateOrderSender(OrderSenderUpdateReq req) {
        OrderRakutenPackageDo orderRakutenPackageDo = packageDao.selectById(req.getBasketId());
        if (orderRakutenPackageDo == null) {
            throw new BizException(SysConstant.Order_Detail_Notfound);
        }
        OrderRakutenDo orderRakutenDo = dao.selectById(orderRakutenPackageDo.getOrderId());
        if (orderRakutenDo == null) {
            throw new BizException(SysConstant.Order_Detail_Notfound);
        }
        ShopDo shop = shopDao.selectById(orderRakutenDo.getShopId());
        LambdaQueryWrapper<OrderRakutenProductDo> productDoLambdaQueryWrapper = new LambdaQueryWrapper<>();
        productDoLambdaQueryWrapper.eq(OrderRakutenProductDo::getBasketId, req.getBasketId());
        List<OrderRakutenProductDo> orderRakutenProductDoList = productDao.selectList(productDoLambdaQueryWrapper);
        for (OrderRakutenProductDo productDo : orderRakutenProductDoList) {
            for (OrderRakutenProductResponse orderRakutenProductResponse : req.getProductResponseList()) {
                orderRakutenProductResponse.setTaxRate(0.1);
                if (orderRakutenProductResponse.getItemDetailId().longValue() == productDo.getItemDetailId().longValue()) {
                    orderRakutenProductResponse.setIncludeTaxFlag(productDo.getIncludeTaxFlag());
                    orderRakutenProductResponse.setIncludePostageFlag(productDo.getIncludePostageFlag());
                    orderRakutenProductResponse.setIncludeCashOnDeliveryPostageFlag(productDo.getIncludeCashOnDeliveryPostageFlag());
                    BeanUtils.copyProperties(orderRakutenProductResponse, productDo);
                    productDao.updateById(productDo);
                }
            }
        }
        BeanUtils.copyProperties(req, orderRakutenPackageDo);
        packageDao.updateById(orderRakutenPackageDo);
        //构造请求参数
        Map requestMap = new HashMap();
        requestMap.put("orderNumber", orderRakutenDo.getOrderNumber());
        requestMap.put("reductionReason", 10);
        List<OrderSenderUpdateReq> reqList = new ArrayList<>();
        SenderModelEntity senderModelEntity = new SenderModelEntity();
        String zipCode = req.getOrderPostCode().replace("-", "");
        senderModelEntity.setZipCode1(zipCode.substring(0, 3));
        senderModelEntity.setZipCode2(zipCode.substring(3));
        senderModelEntity.setPrefecture(req.getOrderPrefecture());
        senderModelEntity.setCity(req.getOrderCity());
        senderModelEntity.setSubAddress(req.getOrderSubAddres());
        senderModelEntity.setFamilyName(req.getOrderName());
        senderModelEntity.setFirstName(" ");
        String phone = req.getOrderPhoneNumber().replaceAll("-", "");
        senderModelEntity.setPhoneNumber1(phone.substring(0, 3));
        senderModelEntity.setPhoneNumber2(phone.substring(3, 7));
        senderModelEntity.setPhoneNumber3(phone.substring(7));
        req.setSenderModel(senderModelEntity);
//        req.setProductResponseList(null);
        reqList.add(req);
        requestMap.put("PackageModelList", reqList);
        List<OrderRakutenCouponDo> couponList = new ArrayList<>();
        List<OrderRakutenCouponDo> orderRakutenCouponDos = rakutenCouponDao.selectList(new LambdaQueryWrapper<OrderRakutenCouponDo>()
                .eq(OrderRakutenCouponDo::getOrderId, orderRakutenDo.getId()));
        if (orderRakutenCouponDos != null && orderRakutenCouponDos.size() > 0) {
            List<OrderRakutenCouponRequest> couponRequestList = orderRakutenCouponDos.stream().map(new Function<OrderRakutenCouponDo, OrderRakutenCouponRequest>() {
                @Override
                public OrderRakutenCouponRequest apply(OrderRakutenCouponDo orderRakutenCouponDo) {
                    OrderRakutenCouponRequest request = new OrderRakutenCouponRequest();
                    BeanUtils.copyProperties(orderRakutenCouponDo, request);
                    return request;
                }
            }).collect(Collectors.toList());
            requestMap.put("CouponModelList", couponRequestList);
        }

        //保存到乐天服务器
        String requestBody = JSON.toJSONString(requestMap);
        logger.debug(requestBody);
        String authorization = "ESA " + Base64.getEncoder().encodeToString((shop.getRakutenSecret() + ":" + shop.getRakutenLicense()).getBytes());
        String jsonData = OkHttpUtils.okHttpRequestPost(GlobalConstants.RakutenURL + "/order/updateOrderSender/",
                HttpMethod.POST.name(), requestBody, authorization);
        JSONObject orderBody = JSON.parseObject(jsonData);
        if ("ORDER_EXT_API_UPDATE_ORDERSENDER_INFO_101".equals(orderBody.getJSONArray("MessageModelList").getJSONObject(0).getString("messageCode"))) {

        } else {
            throw new BizException(orderBody.getJSONArray("MessageModelList").getJSONObject(0).getString("message"));
        }
        return SingleResult.success();
    }

    /**
     * order/updateOrderOrderer/
     *
     * @param req
     * @return
     */
    @Override
    public SingleResult updateOrderBaseInfo(OrderBaseInfoUpdateReq req) {
        OrderRakutenDo orderRakutenDo = dao.selectById(req.getId());
        if (orderRakutenDo == null) {
            throw new BizException(SysConstant.Order_Detail_Notfound);
        }
        ShopDo shop = shopDao.selectById(orderRakutenDo.getShopId());

        //构造请求参数(订购人信息)
        Map requestMap = new HashMap();
        if (!orderRakutenDo.getOrderSubAddres().equals(req.getOrderSubAddres()) || !orderRakutenDo.getOrderName().equals(req.getOrderName())
                || orderRakutenDo.getOrderPhoneNumber().equals(req.getOrderPhoneNumber())) {
            SenderModelEntity senderModelEntity = new SenderModelEntity();
            String zipCode = orderRakutenDo.getOrderPostCode().replace("-", "");
            senderModelEntity.setZipCode1(zipCode.substring(0, 3));
            senderModelEntity.setZipCode2(zipCode.substring(3));
            senderModelEntity.setPrefecture(orderRakutenDo.getOrderPrefecture());
            senderModelEntity.setCity(orderRakutenDo.getOrderCity());
            senderModelEntity.setSubAddress(req.getOrderSubAddres());
            String[] names = null;
            try {
                names = req.getOrderName().split(" ");
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (names == null || names.length < 2) {
                senderModelEntity.setFamilyName(req.getOrderName());
                senderModelEntity.setFirstName(" ");
            } else {
                senderModelEntity.setFamilyName(names[0]);
                senderModelEntity.setFirstName(names[1]);
            }
            String phone = req.getOrderPhoneNumber().replaceAll("-", "");
            senderModelEntity.setPhoneNumber1(phone.substring(0, 3));
            senderModelEntity.setPhoneNumber2(phone.substring(3, 7));
            senderModelEntity.setPhoneNumber3(phone.substring(7));
            requestMap.put("orderNumber", orderRakutenDo.getOrderNumber());
            requestMap.put("OrdererModel", senderModelEntity);
            //保存到乐天服务器
            String requestBody = JSON.toJSONString(requestMap);
            logger.debug(requestBody);
            String authorization = "ESA " + Base64.getEncoder().encodeToString((shop.getRakutenSecret() + ":" + shop.getRakutenLicense()).getBytes());
            String orderResponse = OkHttpUtils.okHttpRequestPost(GlobalConstants.RakutenURL + "/order/updateOrderOrderer/",
                    HttpMethod.POST.name(), requestBody, authorization);
            JSONObject orderBody = JSON.parseObject(orderResponse);
            if ("ORDER_EXT_API_UPDATE_ORDERORDERER_INFO_101".equals(orderBody.getJSONArray("MessageModelList").getJSONObject(0).getString("messageCode"))) {

            } else {
                throw new BizException(orderBody.getJSONArray("MessageModelList").getJSONObject(0).getString("message"));
            }
        }
        int shippingNumber;
        requestMap = new HashMap();
        requestMap.put("orderNumber", orderRakutenDo.getOrderNumber());
        requestMap.put("deliveryDate", req.getDeliveryDate());
        if (StringUtils.isBlank(req.getShippingTerm()) || req.getShippingTerm().equals("-")) {
            shippingNumber = 0;
        } else if (req.getShippingTerm().equals("09-12") || req.getShippingTerm().equals("08-12") || "1u-un".equals(req.getShippingTerm())) {
            shippingNumber = 1;
        } else {
            shippingNumber = Integer.parseInt(req.getShippingTerm().replaceAll("-", ""));
        }
        requestMap.put("shippingTerm", shippingNumber);
//        requestMap.put("memo",req.getSystemMemo());
        //保存到乐天服务器
        String requestBody = JSON.toJSONString(requestMap);
        String authorization = "ESA " + Base64.getEncoder().encodeToString((shop.getRakutenSecret() + ":" + shop.getRakutenLicense()).getBytes());
        logger.debug(requestBody);
        String memoResponse = OkHttpUtils.okHttpRequestPost(GlobalConstants.RakutenURL + "/order/updateOrderMemo/",
                HttpMethod.POST.name(), requestBody, authorization);
        JSONObject memoBody = JSON.parseObject(memoResponse);
        if ("ORDER_EXT_API_UPDATE_ORDERMEMO_INFO_101".equals(memoBody.getJSONArray("MessageModelList").getJSONObject(0).getString("messageCode"))) {

        } else {
            throw new BizException(memoBody.getJSONArray("MessageModelList").getJSONObject(0).getString("message"));
        }
        BeanUtils.copyProperties(req, orderRakutenDo);
        dao.updateById(orderRakutenDo);
        return SingleResult.success();
    }

    //查询分页列表之后对列表数据的处理
    private List<OrderRakutenListRes> handlerListAfter(List<OrderRakutenDo> list) {
        List<OrderRakutenListRes> result = new ArrayList<>();
        for (OrderRakutenDo sourceDo :
                list) {
            OrderRakutenListRes targetDo = new OrderRakutenListRes();
            BeanUtils.copyProperties(sourceDo, targetDo);
            targetDo.setShipmentType(sourceDo.getAsurakuFlag());
            CompanyDo companyDo = companyDao.selectById(sourceDo.getCompanyId());
            QueryWrapper wrapper = new QueryWrapper();
            wrapper.eq("order_id", sourceDo.getId());
            List<OrderRakutenPackageDo> packageDoList = packageDao.selectList(wrapper);
            QueryWrapper wrapper1 = new QueryWrapper();
            if (packageDoList == null || packageDoList.size() < 1) continue;
            wrapper1.eq("basket_id", packageDoList.get(0).getBasketId());
            List<OrderRakutenProductDo> productDoList = productDao.selectList(wrapper1);
            if (companyDo != null) {
                targetDo.setCompanyCode(companyDo.getCompanyCode());
            }
            String commoditySku = null;
            for (OrderRakutenProductDo product :
                    productDoList) {
                if (commoditySku == null) {
                    commoditySku = product.getItemNumber();
                } else {
                    commoditySku = commoditySku + product.getItemNumber();
                }
            }
            targetDo.setCommoditySku(commoditySku);
            result.add(targetDo);
        }
        return result;
    }

    private IPage<OrderRakutenDo> pageInit(Map<String, String> map) {
        IPage<OrderRakutenDo> page = new Page();
        page.setSize(StringUtils.isNotBlank(map.get("pageSize")) ? Long.parseLong(map.get("pageSize")) : 10);
        page.setCurrent(StringUtils.isNotBlank(map.get("current")) ? Long.parseLong(map.get("current")) : 1);
        return page;
    }

    private QueryWrapper<OrderRakutenDo> queryBuild(Map<String, String> map) {
        QueryWrapper<OrderRakutenDo> wrapper = new QueryWrapper<>();
        if (StringUtils.isNotBlank(map.get("keyword"))) {
            wrapper.or(orderRakutenDoQueryWrapper -> {
                orderRakutenDoQueryWrapper.like("order_number", map.get("keyword")).or();
                orderRakutenDoQueryWrapper.like("order_name", map.get("keyword")).or();
                orderRakutenDoQueryWrapper.like("system_memo", map.get("keyword")).or();
                orderRakutenDoQueryWrapper.like("order_phone_number", map.get("keyword"));
            });
        }
        if (map.containsKey("isSend"))
            wrapper.eq("is_send_out", map.get("isSend"));
        if (map.containsKey("orderProgress"))
            wrapper.eq("order_progress", map.get("orderProgress"));
        if (map.containsKey("shipType"))
            wrapper.eq("asuraku_flag", map.get("shipType"));
        if (map.containsKey("shopId"))
            wrapper.eq("shop_id", map.get("shopId"));
        if (StringUtils.isNotBlank(map.get("companyId"))) {
            wrapper.eq("company_id", map.get("companyId"));
        }
        if (orderType1.equals(map.get("dateType"))) {
            if (StringUtils.isNotBlank(map.get("dateEnd")))
                wrapper.lt("order_datetime", map.get("dateEnd"));
            if (StringUtils.isNotBlank(map.get("dateStart")))
                wrapper.gt("order_datetime", map.get("dateStart"));
        } else {//默认用户付款时间
            if (StringUtils.isNotBlank(map.get("dateEnd")))
                wrapper.lt("order_fix_datetime", map.get("dateEnd"));
            if (StringUtils.isNotBlank(map.get("dateStart")))
                wrapper.gt("order_fix_datetime", map.get("dateStart"));
        }
        wrapper.orderByDesc("order_fix_datetime");
        return wrapper;
    }


    /**
     * 自动同步乐天订单
     */
    @Override
    public void autoRefreshOrder() {
        List<ShopDo> shopBeans = mShopService.list();
        for (ShopDo shop :
                shopBeans) {

            if (shop.getRakutenSecret() != null && shop.getRakutenLicense() != null) {
                String[] orderIds = new String[0];
                try {
                    verifyShopTokenExist(shop.getId());
                    orderIds = getRakutenOrderIds(TimeUtils.getAfterTimeFormat("yyyy-MM-dd'T'HH:mm:ss", -24, 0) + "+0900", TimeUtils.getCurrentDateFormat() + "T"
                            + TimeUtils.getAfterTimeFormat("HH:mm:ss", 1, 0) + "+0900", orderType3, orderProgressComm, shop.getRakutenSecret(), shop.getRakutenLicense());
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }
                getOrderNew(orderIds, shop);
            }
        }
    }

    /**
     * 自动同步乐天订单
     */
    @Override
    public void autoRefreshOrder3() {
        ShopDo shop = mShopService.getById(503L);
        System.out.println("503 开始同步");

        if (shop.getRakutenSecret() != null && shop.getRakutenLicense() != null) {
            String[] orderIds = new String[0];
            try {
                verifyShopTokenExist(shop.getId());
                orderIds = getRakutenOrderIds("2023-06-01T00:00:00+0900", "2023-07-12T15:00:00+0900", orderType3, orderProgressComm, shop.getRakutenSecret(), shop.getRakutenLicense());
            } catch (Exception e) {
                e.printStackTrace();
            }
            getOrderNew(orderIds, shop);
        }

    }


    /**
     * 自动同步乐天订单
     */
    @Override
    public void autoRefreshOrder2() {
        List<ShopDo> shopBeans = mShopService.list();
        for (ShopDo shop :
                shopBeans) {
            if (shop.getRakutenSecret() != null && shop.getRakutenLicense() != null) {
                String[] orderIds = new String[0];
                try {
                    getOrder(filterOrders(orderIds, shop), shop);
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }

            }
        }
    }


    @Override
    public void autoRefreshOrderFix(String date) {
        List<ShopDo> shopBeans = mShopService.list();
        for (ShopDo shop :
                shopBeans) {
            if (shop.getRakutenSecret() != null && shop.getRakutenLicense() != null) {
                String[] orderIds = new String[0];
                String dateEnd = date + "T"
                        + "05:15:00";
                String dateStart = TimeUtils.getAfterTimeFormat(dateEnd, "yyyy-MM-dd'T'HH:mm:ss", -7, 0);
                try {
                    orderIds = getRakutenOrderIds(dateStart + "+0900", dateEnd + "+0900", orderType3, orderProgressComm, shop.getRakutenSecret(), shop.getRakutenLicense());
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }
                getOrder(filterOrders(orderIds, shop), shop);
            }
        }
    }

    private String[] filterOrders(String[] orderIds, ShopDo shop) {
        LambdaQueryWrapper<OrderRakutenDo> wrapper = new LambdaQueryWrapper<>();
        wrapper.in(OrderRakutenDo::getOrderProgress, Arrays.asList(orderProgressUnComplete));
        wrapper.gt(OrderRakutenDo::getOrderDatetime, TimeUtils.getCurrentDateFormat(-20));
        wrapper.eq(OrderRakutenDo::getShopId, shop.getId());
        List<OrderRakutenDo> orderRakutenDoList = dao.selectList(wrapper);
        List<String> orderIdsUnComplete = orderRakutenDoList.stream().map(order -> order.getOrderNumber()).collect(Collectors.toList());
        orderIdsUnComplete.addAll(Arrays.asList(orderIds));
        //订单号去重
        orderIdsUnComplete.stream().distinct();
        return orderIdsUnComplete.toArray(orderIds);
    }

    /**
     * 自动确认乐天待确认订单
     */
    @Override
    public void autoConfirmOrder() {
        List<ShopDo> shopBeans = mShopService.list();
        for (ShopDo shop :
                shopBeans) {
            if (shop.getRakutenSecret() != null && shop.getRakutenLicense() != null) {
                String[] orderIdsUncomfirm = new String[0];
                try {
                    orderIdsUncomfirm = searchOrderUnConfirm(TimeUtils.getCurrentDateFormat(-1) + "T00:00:00+0900", TimeUtils.getCurrentDateFormat() + "T"
                            + TimeUtils.getAfterTimeFormat("HH:mm:ss", 1, 0) + "+0900", orderType1, shop.getRakutenSecret(), shop.getRakutenLicense());
                } catch (Exception e) {
                    e.printStackTrace();
                    continue;
                }
                getOrder(orderIdsUncomfirm, shop);
            }
        }
    }

    /**
     * 乐天运单号上传
     *
     * @param orderShippingModelMap
     */
    @Override
    public void updateRakutenExpressNumberByOrderIds
    (Map<Long, List<OrderShippingModelRequest>> orderShippingModelMap) {
        for (Map.Entry<Long, List<OrderShippingModelRequest>> integerListEntry : orderShippingModelMap.entrySet()) {
            threadPoolTaskExecutor.execute(() -> {
                ShopDo shopBean = mShopService.getShopTokenById(integerListEntry.getKey());
                if (integerListEntry.getValue().size() > 100) {
                    for (int i = 0; i <= integerListEntry.getValue().size() / 100; i++) {
                        if (i == integerListEntry.getValue().size() / 100) {
                            updateOrderShipping(integerListEntry.getValue().subList(i * 100, integerListEntry.getValue().size()), shopBean.getId(),
                                    shopBean.getRakutenSecret(), shopBean.getRakutenLicense());
                        } else {
                            updateOrderShipping(integerListEntry.getValue().subList(i * 100, (i + 1) * 100), shopBean.getId(),
                                    shopBean.getRakutenSecret(), shopBean.getRakutenLicense());

                        }
                    }
                } else {
                    updateOrderShipping(integerListEntry.getValue(), shopBean.getId(), shopBean.getRakutenSecret(), shopBean.getRakutenLicense());
                }
            });
        }
    }

    @Override
    public List<Map> ordersyncInit(Long currentUserId, Long companyId) {
        return mShopService.selectShopListInit(currentUserId, companyId);
    }


    public void getShopMsg(Long shopId) {
        ShopDo shopDo = shopDao.selectById(shopId);
        if (shopDo.getPlatformId().equals(DicBusinessItemConstant.rakuton)) {

        }
        String url = "https://api.rms.rakuten.co.jp/es/1.0/shop/shopMaster";
        String jsonData = null;
        try {
            jsonData = RakutenUtil.raAPidoGet(url, shopDo.getRakutenSecret(), shopDo.getRakutenLicense(), new HashMap());
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(jsonData);
    }

}
